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