{-# 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.DeregisterTaskDefinition
(
DeregisterTaskDefinition (..),
newDeregisterTaskDefinition,
deregisterTaskDefinition_taskDefinition,
DeregisterTaskDefinitionResponse (..),
newDeregisterTaskDefinitionResponse,
deregisterTaskDefinitionResponse_taskDefinition,
deregisterTaskDefinitionResponse_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 DeregisterTaskDefinition = DeregisterTaskDefinition'
{
DeregisterTaskDefinition -> Text
taskDefinition :: Prelude.Text
}
deriving (DeregisterTaskDefinition -> DeregisterTaskDefinition -> Bool
(DeregisterTaskDefinition -> DeregisterTaskDefinition -> Bool)
-> (DeregisterTaskDefinition -> DeregisterTaskDefinition -> Bool)
-> Eq DeregisterTaskDefinition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeregisterTaskDefinition -> DeregisterTaskDefinition -> Bool
$c/= :: DeregisterTaskDefinition -> DeregisterTaskDefinition -> Bool
== :: DeregisterTaskDefinition -> DeregisterTaskDefinition -> Bool
$c== :: DeregisterTaskDefinition -> DeregisterTaskDefinition -> Bool
Prelude.Eq, ReadPrec [DeregisterTaskDefinition]
ReadPrec DeregisterTaskDefinition
Int -> ReadS DeregisterTaskDefinition
ReadS [DeregisterTaskDefinition]
(Int -> ReadS DeregisterTaskDefinition)
-> ReadS [DeregisterTaskDefinition]
-> ReadPrec DeregisterTaskDefinition
-> ReadPrec [DeregisterTaskDefinition]
-> Read DeregisterTaskDefinition
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeregisterTaskDefinition]
$creadListPrec :: ReadPrec [DeregisterTaskDefinition]
readPrec :: ReadPrec DeregisterTaskDefinition
$creadPrec :: ReadPrec DeregisterTaskDefinition
readList :: ReadS [DeregisterTaskDefinition]
$creadList :: ReadS [DeregisterTaskDefinition]
readsPrec :: Int -> ReadS DeregisterTaskDefinition
$creadsPrec :: Int -> ReadS DeregisterTaskDefinition
Prelude.Read, Int -> DeregisterTaskDefinition -> ShowS
[DeregisterTaskDefinition] -> ShowS
DeregisterTaskDefinition -> String
(Int -> DeregisterTaskDefinition -> ShowS)
-> (DeregisterTaskDefinition -> String)
-> ([DeregisterTaskDefinition] -> ShowS)
-> Show DeregisterTaskDefinition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeregisterTaskDefinition] -> ShowS
$cshowList :: [DeregisterTaskDefinition] -> ShowS
show :: DeregisterTaskDefinition -> String
$cshow :: DeregisterTaskDefinition -> String
showsPrec :: Int -> DeregisterTaskDefinition -> ShowS
$cshowsPrec :: Int -> DeregisterTaskDefinition -> ShowS
Prelude.Show, (forall x.
DeregisterTaskDefinition -> Rep DeregisterTaskDefinition x)
-> (forall x.
Rep DeregisterTaskDefinition x -> DeregisterTaskDefinition)
-> Generic DeregisterTaskDefinition
forall x.
Rep DeregisterTaskDefinition x -> DeregisterTaskDefinition
forall x.
DeregisterTaskDefinition -> Rep DeregisterTaskDefinition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeregisterTaskDefinition x -> DeregisterTaskDefinition
$cfrom :: forall x.
DeregisterTaskDefinition -> Rep DeregisterTaskDefinition x
Prelude.Generic)
newDeregisterTaskDefinition ::
Prelude.Text ->
DeregisterTaskDefinition
newDeregisterTaskDefinition :: Text -> DeregisterTaskDefinition
newDeregisterTaskDefinition Text
pTaskDefinition_ =
DeregisterTaskDefinition' :: Text -> DeregisterTaskDefinition
DeregisterTaskDefinition'
{ $sel:taskDefinition:DeregisterTaskDefinition' :: Text
taskDefinition =
Text
pTaskDefinition_
}
deregisterTaskDefinition_taskDefinition :: Lens.Lens' DeregisterTaskDefinition Prelude.Text
deregisterTaskDefinition_taskDefinition :: (Text -> f Text)
-> DeregisterTaskDefinition -> f DeregisterTaskDefinition
deregisterTaskDefinition_taskDefinition = (DeregisterTaskDefinition -> Text)
-> (DeregisterTaskDefinition -> Text -> DeregisterTaskDefinition)
-> Lens DeregisterTaskDefinition DeregisterTaskDefinition Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeregisterTaskDefinition' {Text
taskDefinition :: Text
$sel:taskDefinition:DeregisterTaskDefinition' :: DeregisterTaskDefinition -> Text
taskDefinition} -> Text
taskDefinition) (\s :: DeregisterTaskDefinition
s@DeregisterTaskDefinition' {} Text
a -> DeregisterTaskDefinition
s {$sel:taskDefinition:DeregisterTaskDefinition' :: Text
taskDefinition = Text
a} :: DeregisterTaskDefinition)
instance Core.AWSRequest DeregisterTaskDefinition where
type
AWSResponse DeregisterTaskDefinition =
DeregisterTaskDefinitionResponse
request :: DeregisterTaskDefinition -> Request DeregisterTaskDefinition
request = Service
-> DeregisterTaskDefinition -> Request DeregisterTaskDefinition
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeregisterTaskDefinition
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeregisterTaskDefinition)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeregisterTaskDefinition))
-> Logger
-> Service
-> Proxy DeregisterTaskDefinition
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeregisterTaskDefinition)))
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 TaskDefinition -> Int -> DeregisterTaskDefinitionResponse
DeregisterTaskDefinitionResponse'
(Maybe TaskDefinition -> Int -> DeregisterTaskDefinitionResponse)
-> Either String (Maybe TaskDefinition)
-> Either String (Int -> DeregisterTaskDefinitionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe TaskDefinition)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"taskDefinition")
Either String (Int -> DeregisterTaskDefinitionResponse)
-> Either String Int
-> Either String DeregisterTaskDefinitionResponse
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 DeregisterTaskDefinition
instance Prelude.NFData DeregisterTaskDefinition
instance Core.ToHeaders DeregisterTaskDefinition where
toHeaders :: DeregisterTaskDefinition -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeregisterTaskDefinition -> 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.DeregisterTaskDefinition" ::
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 DeregisterTaskDefinition where
toJSON :: DeregisterTaskDefinition -> Value
toJSON DeregisterTaskDefinition' {Text
taskDefinition :: Text
$sel:taskDefinition:DeregisterTaskDefinition' :: DeregisterTaskDefinition -> 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
"taskDefinition" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
taskDefinition)
]
)
instance Core.ToPath DeregisterTaskDefinition where
toPath :: DeregisterTaskDefinition -> ByteString
toPath = ByteString -> DeregisterTaskDefinition -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeregisterTaskDefinition where
toQuery :: DeregisterTaskDefinition -> QueryString
toQuery = QueryString -> DeregisterTaskDefinition -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeregisterTaskDefinitionResponse = DeregisterTaskDefinitionResponse'
{
DeregisterTaskDefinitionResponse -> Maybe TaskDefinition
taskDefinition :: Prelude.Maybe TaskDefinition,
DeregisterTaskDefinitionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeregisterTaskDefinitionResponse
-> DeregisterTaskDefinitionResponse -> Bool
(DeregisterTaskDefinitionResponse
-> DeregisterTaskDefinitionResponse -> Bool)
-> (DeregisterTaskDefinitionResponse
-> DeregisterTaskDefinitionResponse -> Bool)
-> Eq DeregisterTaskDefinitionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeregisterTaskDefinitionResponse
-> DeregisterTaskDefinitionResponse -> Bool
$c/= :: DeregisterTaskDefinitionResponse
-> DeregisterTaskDefinitionResponse -> Bool
== :: DeregisterTaskDefinitionResponse
-> DeregisterTaskDefinitionResponse -> Bool
$c== :: DeregisterTaskDefinitionResponse
-> DeregisterTaskDefinitionResponse -> Bool
Prelude.Eq, ReadPrec [DeregisterTaskDefinitionResponse]
ReadPrec DeregisterTaskDefinitionResponse
Int -> ReadS DeregisterTaskDefinitionResponse
ReadS [DeregisterTaskDefinitionResponse]
(Int -> ReadS DeregisterTaskDefinitionResponse)
-> ReadS [DeregisterTaskDefinitionResponse]
-> ReadPrec DeregisterTaskDefinitionResponse
-> ReadPrec [DeregisterTaskDefinitionResponse]
-> Read DeregisterTaskDefinitionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeregisterTaskDefinitionResponse]
$creadListPrec :: ReadPrec [DeregisterTaskDefinitionResponse]
readPrec :: ReadPrec DeregisterTaskDefinitionResponse
$creadPrec :: ReadPrec DeregisterTaskDefinitionResponse
readList :: ReadS [DeregisterTaskDefinitionResponse]
$creadList :: ReadS [DeregisterTaskDefinitionResponse]
readsPrec :: Int -> ReadS DeregisterTaskDefinitionResponse
$creadsPrec :: Int -> ReadS DeregisterTaskDefinitionResponse
Prelude.Read, Int -> DeregisterTaskDefinitionResponse -> ShowS
[DeregisterTaskDefinitionResponse] -> ShowS
DeregisterTaskDefinitionResponse -> String
(Int -> DeregisterTaskDefinitionResponse -> ShowS)
-> (DeregisterTaskDefinitionResponse -> String)
-> ([DeregisterTaskDefinitionResponse] -> ShowS)
-> Show DeregisterTaskDefinitionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeregisterTaskDefinitionResponse] -> ShowS
$cshowList :: [DeregisterTaskDefinitionResponse] -> ShowS
show :: DeregisterTaskDefinitionResponse -> String
$cshow :: DeregisterTaskDefinitionResponse -> String
showsPrec :: Int -> DeregisterTaskDefinitionResponse -> ShowS
$cshowsPrec :: Int -> DeregisterTaskDefinitionResponse -> ShowS
Prelude.Show, (forall x.
DeregisterTaskDefinitionResponse
-> Rep DeregisterTaskDefinitionResponse x)
-> (forall x.
Rep DeregisterTaskDefinitionResponse x
-> DeregisterTaskDefinitionResponse)
-> Generic DeregisterTaskDefinitionResponse
forall x.
Rep DeregisterTaskDefinitionResponse x
-> DeregisterTaskDefinitionResponse
forall x.
DeregisterTaskDefinitionResponse
-> Rep DeregisterTaskDefinitionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeregisterTaskDefinitionResponse x
-> DeregisterTaskDefinitionResponse
$cfrom :: forall x.
DeregisterTaskDefinitionResponse
-> Rep DeregisterTaskDefinitionResponse x
Prelude.Generic)
newDeregisterTaskDefinitionResponse ::
Prelude.Int ->
DeregisterTaskDefinitionResponse
newDeregisterTaskDefinitionResponse :: Int -> DeregisterTaskDefinitionResponse
newDeregisterTaskDefinitionResponse Int
pHttpStatus_ =
DeregisterTaskDefinitionResponse' :: Maybe TaskDefinition -> Int -> DeregisterTaskDefinitionResponse
DeregisterTaskDefinitionResponse'
{ $sel:taskDefinition:DeregisterTaskDefinitionResponse' :: Maybe TaskDefinition
taskDefinition =
Maybe TaskDefinition
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeregisterTaskDefinitionResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deregisterTaskDefinitionResponse_taskDefinition :: Lens.Lens' DeregisterTaskDefinitionResponse (Prelude.Maybe TaskDefinition)
deregisterTaskDefinitionResponse_taskDefinition :: (Maybe TaskDefinition -> f (Maybe TaskDefinition))
-> DeregisterTaskDefinitionResponse
-> f DeregisterTaskDefinitionResponse
deregisterTaskDefinitionResponse_taskDefinition = (DeregisterTaskDefinitionResponse -> Maybe TaskDefinition)
-> (DeregisterTaskDefinitionResponse
-> Maybe TaskDefinition -> DeregisterTaskDefinitionResponse)
-> Lens
DeregisterTaskDefinitionResponse
DeregisterTaskDefinitionResponse
(Maybe TaskDefinition)
(Maybe TaskDefinition)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeregisterTaskDefinitionResponse' {Maybe TaskDefinition
taskDefinition :: Maybe TaskDefinition
$sel:taskDefinition:DeregisterTaskDefinitionResponse' :: DeregisterTaskDefinitionResponse -> Maybe TaskDefinition
taskDefinition} -> Maybe TaskDefinition
taskDefinition) (\s :: DeregisterTaskDefinitionResponse
s@DeregisterTaskDefinitionResponse' {} Maybe TaskDefinition
a -> DeregisterTaskDefinitionResponse
s {$sel:taskDefinition:DeregisterTaskDefinitionResponse' :: Maybe TaskDefinition
taskDefinition = Maybe TaskDefinition
a} :: DeregisterTaskDefinitionResponse)
deregisterTaskDefinitionResponse_httpStatus :: Lens.Lens' DeregisterTaskDefinitionResponse Prelude.Int
deregisterTaskDefinitionResponse_httpStatus :: (Int -> f Int)
-> DeregisterTaskDefinitionResponse
-> f DeregisterTaskDefinitionResponse
deregisterTaskDefinitionResponse_httpStatus = (DeregisterTaskDefinitionResponse -> Int)
-> (DeregisterTaskDefinitionResponse
-> Int -> DeregisterTaskDefinitionResponse)
-> Lens
DeregisterTaskDefinitionResponse
DeregisterTaskDefinitionResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeregisterTaskDefinitionResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeregisterTaskDefinitionResponse' :: DeregisterTaskDefinitionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeregisterTaskDefinitionResponse
s@DeregisterTaskDefinitionResponse' {} Int
a -> DeregisterTaskDefinitionResponse
s {$sel:httpStatus:DeregisterTaskDefinitionResponse' :: Int
httpStatus = Int
a} :: DeregisterTaskDefinitionResponse)
instance
Prelude.NFData
DeregisterTaskDefinitionResponse