{-# 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.ECS.DeleteTaskSet
(
DeleteTaskSet (..),
newDeleteTaskSet,
deleteTaskSet_force,
deleteTaskSet_cluster,
deleteTaskSet_service,
deleteTaskSet_taskSet,
DeleteTaskSetResponse (..),
newDeleteTaskSetResponse,
deleteTaskSetResponse_taskSet,
deleteTaskSetResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.ECS.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 DeleteTaskSet = DeleteTaskSet'
{
DeleteTaskSet -> Maybe Bool
force :: Prelude.Maybe Prelude.Bool,
DeleteTaskSet -> Text
cluster :: Prelude.Text,
DeleteTaskSet -> Text
service :: Prelude.Text,
DeleteTaskSet -> Text
taskSet :: Prelude.Text
}
deriving (DeleteTaskSet -> DeleteTaskSet -> Bool
(DeleteTaskSet -> DeleteTaskSet -> Bool)
-> (DeleteTaskSet -> DeleteTaskSet -> Bool) -> Eq DeleteTaskSet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteTaskSet -> DeleteTaskSet -> Bool
$c/= :: DeleteTaskSet -> DeleteTaskSet -> Bool
== :: DeleteTaskSet -> DeleteTaskSet -> Bool
$c== :: DeleteTaskSet -> DeleteTaskSet -> Bool
Prelude.Eq, ReadPrec [DeleteTaskSet]
ReadPrec DeleteTaskSet
Int -> ReadS DeleteTaskSet
ReadS [DeleteTaskSet]
(Int -> ReadS DeleteTaskSet)
-> ReadS [DeleteTaskSet]
-> ReadPrec DeleteTaskSet
-> ReadPrec [DeleteTaskSet]
-> Read DeleteTaskSet
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteTaskSet]
$creadListPrec :: ReadPrec [DeleteTaskSet]
readPrec :: ReadPrec DeleteTaskSet
$creadPrec :: ReadPrec DeleteTaskSet
readList :: ReadS [DeleteTaskSet]
$creadList :: ReadS [DeleteTaskSet]
readsPrec :: Int -> ReadS DeleteTaskSet
$creadsPrec :: Int -> ReadS DeleteTaskSet
Prelude.Read, Int -> DeleteTaskSet -> ShowS
[DeleteTaskSet] -> ShowS
DeleteTaskSet -> String
(Int -> DeleteTaskSet -> ShowS)
-> (DeleteTaskSet -> String)
-> ([DeleteTaskSet] -> ShowS)
-> Show DeleteTaskSet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteTaskSet] -> ShowS
$cshowList :: [DeleteTaskSet] -> ShowS
show :: DeleteTaskSet -> String
$cshow :: DeleteTaskSet -> String
showsPrec :: Int -> DeleteTaskSet -> ShowS
$cshowsPrec :: Int -> DeleteTaskSet -> ShowS
Prelude.Show, (forall x. DeleteTaskSet -> Rep DeleteTaskSet x)
-> (forall x. Rep DeleteTaskSet x -> DeleteTaskSet)
-> Generic DeleteTaskSet
forall x. Rep DeleteTaskSet x -> DeleteTaskSet
forall x. DeleteTaskSet -> Rep DeleteTaskSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteTaskSet x -> DeleteTaskSet
$cfrom :: forall x. DeleteTaskSet -> Rep DeleteTaskSet x
Prelude.Generic)
newDeleteTaskSet ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
DeleteTaskSet
newDeleteTaskSet :: Text -> Text -> Text -> DeleteTaskSet
newDeleteTaskSet Text
pCluster_ Text
pService_ Text
pTaskSet_ =
DeleteTaskSet' :: Maybe Bool -> Text -> Text -> Text -> DeleteTaskSet
DeleteTaskSet'
{ $sel:force:DeleteTaskSet' :: Maybe Bool
force = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:cluster:DeleteTaskSet' :: Text
cluster = Text
pCluster_,
$sel:service:DeleteTaskSet' :: Text
service = Text
pService_,
$sel:taskSet:DeleteTaskSet' :: Text
taskSet = Text
pTaskSet_
}
deleteTaskSet_force :: Lens.Lens' DeleteTaskSet (Prelude.Maybe Prelude.Bool)
deleteTaskSet_force :: (Maybe Bool -> f (Maybe Bool)) -> DeleteTaskSet -> f DeleteTaskSet
deleteTaskSet_force = (DeleteTaskSet -> Maybe Bool)
-> (DeleteTaskSet -> Maybe Bool -> DeleteTaskSet)
-> Lens DeleteTaskSet DeleteTaskSet (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTaskSet' {Maybe Bool
force :: Maybe Bool
$sel:force:DeleteTaskSet' :: DeleteTaskSet -> Maybe Bool
force} -> Maybe Bool
force) (\s :: DeleteTaskSet
s@DeleteTaskSet' {} Maybe Bool
a -> DeleteTaskSet
s {$sel:force:DeleteTaskSet' :: Maybe Bool
force = Maybe Bool
a} :: DeleteTaskSet)
deleteTaskSet_cluster :: Lens.Lens' DeleteTaskSet Prelude.Text
deleteTaskSet_cluster :: (Text -> f Text) -> DeleteTaskSet -> f DeleteTaskSet
deleteTaskSet_cluster = (DeleteTaskSet -> Text)
-> (DeleteTaskSet -> Text -> DeleteTaskSet)
-> Lens DeleteTaskSet DeleteTaskSet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTaskSet' {Text
cluster :: Text
$sel:cluster:DeleteTaskSet' :: DeleteTaskSet -> Text
cluster} -> Text
cluster) (\s :: DeleteTaskSet
s@DeleteTaskSet' {} Text
a -> DeleteTaskSet
s {$sel:cluster:DeleteTaskSet' :: Text
cluster = Text
a} :: DeleteTaskSet)
deleteTaskSet_service :: Lens.Lens' DeleteTaskSet Prelude.Text
deleteTaskSet_service :: (Text -> f Text) -> DeleteTaskSet -> f DeleteTaskSet
deleteTaskSet_service = (DeleteTaskSet -> Text)
-> (DeleteTaskSet -> Text -> DeleteTaskSet)
-> Lens DeleteTaskSet DeleteTaskSet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTaskSet' {Text
service :: Text
$sel:service:DeleteTaskSet' :: DeleteTaskSet -> Text
service} -> Text
service) (\s :: DeleteTaskSet
s@DeleteTaskSet' {} Text
a -> DeleteTaskSet
s {$sel:service:DeleteTaskSet' :: Text
service = Text
a} :: DeleteTaskSet)
deleteTaskSet_taskSet :: Lens.Lens' DeleteTaskSet Prelude.Text
deleteTaskSet_taskSet :: (Text -> f Text) -> DeleteTaskSet -> f DeleteTaskSet
deleteTaskSet_taskSet = (DeleteTaskSet -> Text)
-> (DeleteTaskSet -> Text -> DeleteTaskSet)
-> Lens DeleteTaskSet DeleteTaskSet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTaskSet' {Text
taskSet :: Text
$sel:taskSet:DeleteTaskSet' :: DeleteTaskSet -> Text
taskSet} -> Text
taskSet) (\s :: DeleteTaskSet
s@DeleteTaskSet' {} Text
a -> DeleteTaskSet
s {$sel:taskSet:DeleteTaskSet' :: Text
taskSet = Text
a} :: DeleteTaskSet)
instance Core.AWSRequest DeleteTaskSet where
type
AWSResponse DeleteTaskSet =
DeleteTaskSetResponse
request :: DeleteTaskSet -> Request DeleteTaskSet
request = Service -> DeleteTaskSet -> Request DeleteTaskSet
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteTaskSet
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteTaskSet)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteTaskSet))
-> Logger
-> Service
-> Proxy DeleteTaskSet
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteTaskSet)))
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 TaskSet -> Int -> DeleteTaskSetResponse
DeleteTaskSetResponse'
(Maybe TaskSet -> Int -> DeleteTaskSetResponse)
-> Either String (Maybe TaskSet)
-> Either String (Int -> DeleteTaskSetResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe TaskSet)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"taskSet")
Either String (Int -> DeleteTaskSetResponse)
-> Either String Int -> Either String DeleteTaskSetResponse
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 DeleteTaskSet
instance Prelude.NFData DeleteTaskSet
instance Core.ToHeaders DeleteTaskSet where
toHeaders :: DeleteTaskSet -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteTaskSet -> 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
"AmazonEC2ContainerServiceV20141113.DeleteTaskSet" ::
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 DeleteTaskSet where
toJSON :: DeleteTaskSet -> Value
toJSON DeleteTaskSet' {Maybe Bool
Text
taskSet :: Text
service :: Text
cluster :: Text
force :: Maybe Bool
$sel:taskSet:DeleteTaskSet' :: DeleteTaskSet -> Text
$sel:service:DeleteTaskSet' :: DeleteTaskSet -> Text
$sel:cluster:DeleteTaskSet' :: DeleteTaskSet -> Text
$sel:force:DeleteTaskSet' :: DeleteTaskSet -> Maybe Bool
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"force" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
force,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"cluster" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
cluster),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"service" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
service),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"taskSet" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
taskSet)
]
)
instance Core.ToPath DeleteTaskSet where
toPath :: DeleteTaskSet -> ByteString
toPath = ByteString -> DeleteTaskSet -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteTaskSet where
toQuery :: DeleteTaskSet -> QueryString
toQuery = QueryString -> DeleteTaskSet -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteTaskSetResponse = DeleteTaskSetResponse'
{
DeleteTaskSetResponse -> Maybe TaskSet
taskSet :: Prelude.Maybe TaskSet,
DeleteTaskSetResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteTaskSetResponse -> DeleteTaskSetResponse -> Bool
(DeleteTaskSetResponse -> DeleteTaskSetResponse -> Bool)
-> (DeleteTaskSetResponse -> DeleteTaskSetResponse -> Bool)
-> Eq DeleteTaskSetResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteTaskSetResponse -> DeleteTaskSetResponse -> Bool
$c/= :: DeleteTaskSetResponse -> DeleteTaskSetResponse -> Bool
== :: DeleteTaskSetResponse -> DeleteTaskSetResponse -> Bool
$c== :: DeleteTaskSetResponse -> DeleteTaskSetResponse -> Bool
Prelude.Eq, ReadPrec [DeleteTaskSetResponse]
ReadPrec DeleteTaskSetResponse
Int -> ReadS DeleteTaskSetResponse
ReadS [DeleteTaskSetResponse]
(Int -> ReadS DeleteTaskSetResponse)
-> ReadS [DeleteTaskSetResponse]
-> ReadPrec DeleteTaskSetResponse
-> ReadPrec [DeleteTaskSetResponse]
-> Read DeleteTaskSetResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteTaskSetResponse]
$creadListPrec :: ReadPrec [DeleteTaskSetResponse]
readPrec :: ReadPrec DeleteTaskSetResponse
$creadPrec :: ReadPrec DeleteTaskSetResponse
readList :: ReadS [DeleteTaskSetResponse]
$creadList :: ReadS [DeleteTaskSetResponse]
readsPrec :: Int -> ReadS DeleteTaskSetResponse
$creadsPrec :: Int -> ReadS DeleteTaskSetResponse
Prelude.Read, Int -> DeleteTaskSetResponse -> ShowS
[DeleteTaskSetResponse] -> ShowS
DeleteTaskSetResponse -> String
(Int -> DeleteTaskSetResponse -> ShowS)
-> (DeleteTaskSetResponse -> String)
-> ([DeleteTaskSetResponse] -> ShowS)
-> Show DeleteTaskSetResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteTaskSetResponse] -> ShowS
$cshowList :: [DeleteTaskSetResponse] -> ShowS
show :: DeleteTaskSetResponse -> String
$cshow :: DeleteTaskSetResponse -> String
showsPrec :: Int -> DeleteTaskSetResponse -> ShowS
$cshowsPrec :: Int -> DeleteTaskSetResponse -> ShowS
Prelude.Show, (forall x. DeleteTaskSetResponse -> Rep DeleteTaskSetResponse x)
-> (forall x. Rep DeleteTaskSetResponse x -> DeleteTaskSetResponse)
-> Generic DeleteTaskSetResponse
forall x. Rep DeleteTaskSetResponse x -> DeleteTaskSetResponse
forall x. DeleteTaskSetResponse -> Rep DeleteTaskSetResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteTaskSetResponse x -> DeleteTaskSetResponse
$cfrom :: forall x. DeleteTaskSetResponse -> Rep DeleteTaskSetResponse x
Prelude.Generic)
newDeleteTaskSetResponse ::
Prelude.Int ->
DeleteTaskSetResponse
newDeleteTaskSetResponse :: Int -> DeleteTaskSetResponse
newDeleteTaskSetResponse Int
pHttpStatus_ =
DeleteTaskSetResponse' :: Maybe TaskSet -> Int -> DeleteTaskSetResponse
DeleteTaskSetResponse'
{ $sel:taskSet:DeleteTaskSetResponse' :: Maybe TaskSet
taskSet = Maybe TaskSet
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteTaskSetResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteTaskSetResponse_taskSet :: Lens.Lens' DeleteTaskSetResponse (Prelude.Maybe TaskSet)
deleteTaskSetResponse_taskSet :: (Maybe TaskSet -> f (Maybe TaskSet))
-> DeleteTaskSetResponse -> f DeleteTaskSetResponse
deleteTaskSetResponse_taskSet = (DeleteTaskSetResponse -> Maybe TaskSet)
-> (DeleteTaskSetResponse
-> Maybe TaskSet -> DeleteTaskSetResponse)
-> Lens
DeleteTaskSetResponse
DeleteTaskSetResponse
(Maybe TaskSet)
(Maybe TaskSet)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTaskSetResponse' {Maybe TaskSet
taskSet :: Maybe TaskSet
$sel:taskSet:DeleteTaskSetResponse' :: DeleteTaskSetResponse -> Maybe TaskSet
taskSet} -> Maybe TaskSet
taskSet) (\s :: DeleteTaskSetResponse
s@DeleteTaskSetResponse' {} Maybe TaskSet
a -> DeleteTaskSetResponse
s {$sel:taskSet:DeleteTaskSetResponse' :: Maybe TaskSet
taskSet = Maybe TaskSet
a} :: DeleteTaskSetResponse)
deleteTaskSetResponse_httpStatus :: Lens.Lens' DeleteTaskSetResponse Prelude.Int
deleteTaskSetResponse_httpStatus :: (Int -> f Int) -> DeleteTaskSetResponse -> f DeleteTaskSetResponse
deleteTaskSetResponse_httpStatus = (DeleteTaskSetResponse -> Int)
-> (DeleteTaskSetResponse -> Int -> DeleteTaskSetResponse)
-> Lens DeleteTaskSetResponse DeleteTaskSetResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTaskSetResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteTaskSetResponse' :: DeleteTaskSetResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteTaskSetResponse
s@DeleteTaskSetResponse' {} Int
a -> DeleteTaskSetResponse
s {$sel:httpStatus:DeleteTaskSetResponse' :: Int
httpStatus = Int
a} :: DeleteTaskSetResponse)
instance Prelude.NFData DeleteTaskSetResponse