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