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