{-# 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.EMRContainers.DeleteManagedEndpoint
(
DeleteManagedEndpoint (..),
newDeleteManagedEndpoint,
deleteManagedEndpoint_id,
deleteManagedEndpoint_virtualClusterId,
DeleteManagedEndpointResponse (..),
newDeleteManagedEndpointResponse,
deleteManagedEndpointResponse_id,
deleteManagedEndpointResponse_virtualClusterId,
deleteManagedEndpointResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.EMRContainers.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 DeleteManagedEndpoint = DeleteManagedEndpoint'
{
DeleteManagedEndpoint -> Text
id :: Prelude.Text,
DeleteManagedEndpoint -> Text
virtualClusterId :: Prelude.Text
}
deriving (DeleteManagedEndpoint -> DeleteManagedEndpoint -> Bool
(DeleteManagedEndpoint -> DeleteManagedEndpoint -> Bool)
-> (DeleteManagedEndpoint -> DeleteManagedEndpoint -> Bool)
-> Eq DeleteManagedEndpoint
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteManagedEndpoint -> DeleteManagedEndpoint -> Bool
$c/= :: DeleteManagedEndpoint -> DeleteManagedEndpoint -> Bool
== :: DeleteManagedEndpoint -> DeleteManagedEndpoint -> Bool
$c== :: DeleteManagedEndpoint -> DeleteManagedEndpoint -> Bool
Prelude.Eq, ReadPrec [DeleteManagedEndpoint]
ReadPrec DeleteManagedEndpoint
Int -> ReadS DeleteManagedEndpoint
ReadS [DeleteManagedEndpoint]
(Int -> ReadS DeleteManagedEndpoint)
-> ReadS [DeleteManagedEndpoint]
-> ReadPrec DeleteManagedEndpoint
-> ReadPrec [DeleteManagedEndpoint]
-> Read DeleteManagedEndpoint
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteManagedEndpoint]
$creadListPrec :: ReadPrec [DeleteManagedEndpoint]
readPrec :: ReadPrec DeleteManagedEndpoint
$creadPrec :: ReadPrec DeleteManagedEndpoint
readList :: ReadS [DeleteManagedEndpoint]
$creadList :: ReadS [DeleteManagedEndpoint]
readsPrec :: Int -> ReadS DeleteManagedEndpoint
$creadsPrec :: Int -> ReadS DeleteManagedEndpoint
Prelude.Read, Int -> DeleteManagedEndpoint -> ShowS
[DeleteManagedEndpoint] -> ShowS
DeleteManagedEndpoint -> String
(Int -> DeleteManagedEndpoint -> ShowS)
-> (DeleteManagedEndpoint -> String)
-> ([DeleteManagedEndpoint] -> ShowS)
-> Show DeleteManagedEndpoint
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteManagedEndpoint] -> ShowS
$cshowList :: [DeleteManagedEndpoint] -> ShowS
show :: DeleteManagedEndpoint -> String
$cshow :: DeleteManagedEndpoint -> String
showsPrec :: Int -> DeleteManagedEndpoint -> ShowS
$cshowsPrec :: Int -> DeleteManagedEndpoint -> ShowS
Prelude.Show, (forall x. DeleteManagedEndpoint -> Rep DeleteManagedEndpoint x)
-> (forall x. Rep DeleteManagedEndpoint x -> DeleteManagedEndpoint)
-> Generic DeleteManagedEndpoint
forall x. Rep DeleteManagedEndpoint x -> DeleteManagedEndpoint
forall x. DeleteManagedEndpoint -> Rep DeleteManagedEndpoint x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteManagedEndpoint x -> DeleteManagedEndpoint
$cfrom :: forall x. DeleteManagedEndpoint -> Rep DeleteManagedEndpoint x
Prelude.Generic)
newDeleteManagedEndpoint ::
Prelude.Text ->
Prelude.Text ->
DeleteManagedEndpoint
newDeleteManagedEndpoint :: Text -> Text -> DeleteManagedEndpoint
newDeleteManagedEndpoint Text
pId_ Text
pVirtualClusterId_ =
DeleteManagedEndpoint' :: Text -> Text -> DeleteManagedEndpoint
DeleteManagedEndpoint'
{ $sel:id:DeleteManagedEndpoint' :: Text
id = Text
pId_,
$sel:virtualClusterId:DeleteManagedEndpoint' :: Text
virtualClusterId = Text
pVirtualClusterId_
}
deleteManagedEndpoint_id :: Lens.Lens' DeleteManagedEndpoint Prelude.Text
deleteManagedEndpoint_id :: (Text -> f Text)
-> DeleteManagedEndpoint -> f DeleteManagedEndpoint
deleteManagedEndpoint_id = (DeleteManagedEndpoint -> Text)
-> (DeleteManagedEndpoint -> Text -> DeleteManagedEndpoint)
-> Lens DeleteManagedEndpoint DeleteManagedEndpoint Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteManagedEndpoint' {Text
id :: Text
$sel:id:DeleteManagedEndpoint' :: DeleteManagedEndpoint -> Text
id} -> Text
id) (\s :: DeleteManagedEndpoint
s@DeleteManagedEndpoint' {} Text
a -> DeleteManagedEndpoint
s {$sel:id:DeleteManagedEndpoint' :: Text
id = Text
a} :: DeleteManagedEndpoint)
deleteManagedEndpoint_virtualClusterId :: Lens.Lens' DeleteManagedEndpoint Prelude.Text
deleteManagedEndpoint_virtualClusterId :: (Text -> f Text)
-> DeleteManagedEndpoint -> f DeleteManagedEndpoint
deleteManagedEndpoint_virtualClusterId = (DeleteManagedEndpoint -> Text)
-> (DeleteManagedEndpoint -> Text -> DeleteManagedEndpoint)
-> Lens DeleteManagedEndpoint DeleteManagedEndpoint Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteManagedEndpoint' {Text
virtualClusterId :: Text
$sel:virtualClusterId:DeleteManagedEndpoint' :: DeleteManagedEndpoint -> Text
virtualClusterId} -> Text
virtualClusterId) (\s :: DeleteManagedEndpoint
s@DeleteManagedEndpoint' {} Text
a -> DeleteManagedEndpoint
s {$sel:virtualClusterId:DeleteManagedEndpoint' :: Text
virtualClusterId = Text
a} :: DeleteManagedEndpoint)
instance Core.AWSRequest DeleteManagedEndpoint where
type
AWSResponse DeleteManagedEndpoint =
DeleteManagedEndpointResponse
request :: DeleteManagedEndpoint -> Request DeleteManagedEndpoint
request = Service -> DeleteManagedEndpoint -> Request DeleteManagedEndpoint
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteManagedEndpoint
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteManagedEndpoint)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteManagedEndpoint))
-> Logger
-> Service
-> Proxy DeleteManagedEndpoint
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteManagedEndpoint)))
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 Text -> Maybe Text -> Int -> DeleteManagedEndpointResponse
DeleteManagedEndpointResponse'
(Maybe Text -> Maybe Text -> Int -> DeleteManagedEndpointResponse)
-> Either String (Maybe Text)
-> Either
String (Maybe Text -> Int -> DeleteManagedEndpointResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"id")
Either String (Maybe Text -> Int -> DeleteManagedEndpointResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DeleteManagedEndpointResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"virtualClusterId")
Either String (Int -> DeleteManagedEndpointResponse)
-> Either String Int -> Either String DeleteManagedEndpointResponse
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 DeleteManagedEndpoint
instance Prelude.NFData DeleteManagedEndpoint
instance Core.ToHeaders DeleteManagedEndpoint where
toHeaders :: DeleteManagedEndpoint -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteManagedEndpoint -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ 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.ToPath DeleteManagedEndpoint where
toPath :: DeleteManagedEndpoint -> ByteString
toPath DeleteManagedEndpoint' {Text
virtualClusterId :: Text
id :: Text
$sel:virtualClusterId:DeleteManagedEndpoint' :: DeleteManagedEndpoint -> Text
$sel:id:DeleteManagedEndpoint' :: DeleteManagedEndpoint -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/virtualclusters/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
virtualClusterId,
ByteString
"/endpoints/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
id
]
instance Core.ToQuery DeleteManagedEndpoint where
toQuery :: DeleteManagedEndpoint -> QueryString
toQuery = QueryString -> DeleteManagedEndpoint -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteManagedEndpointResponse = DeleteManagedEndpointResponse'
{
DeleteManagedEndpointResponse -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
DeleteManagedEndpointResponse -> Maybe Text
virtualClusterId :: Prelude.Maybe Prelude.Text,
DeleteManagedEndpointResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteManagedEndpointResponse
-> DeleteManagedEndpointResponse -> Bool
(DeleteManagedEndpointResponse
-> DeleteManagedEndpointResponse -> Bool)
-> (DeleteManagedEndpointResponse
-> DeleteManagedEndpointResponse -> Bool)
-> Eq DeleteManagedEndpointResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteManagedEndpointResponse
-> DeleteManagedEndpointResponse -> Bool
$c/= :: DeleteManagedEndpointResponse
-> DeleteManagedEndpointResponse -> Bool
== :: DeleteManagedEndpointResponse
-> DeleteManagedEndpointResponse -> Bool
$c== :: DeleteManagedEndpointResponse
-> DeleteManagedEndpointResponse -> Bool
Prelude.Eq, ReadPrec [DeleteManagedEndpointResponse]
ReadPrec DeleteManagedEndpointResponse
Int -> ReadS DeleteManagedEndpointResponse
ReadS [DeleteManagedEndpointResponse]
(Int -> ReadS DeleteManagedEndpointResponse)
-> ReadS [DeleteManagedEndpointResponse]
-> ReadPrec DeleteManagedEndpointResponse
-> ReadPrec [DeleteManagedEndpointResponse]
-> Read DeleteManagedEndpointResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteManagedEndpointResponse]
$creadListPrec :: ReadPrec [DeleteManagedEndpointResponse]
readPrec :: ReadPrec DeleteManagedEndpointResponse
$creadPrec :: ReadPrec DeleteManagedEndpointResponse
readList :: ReadS [DeleteManagedEndpointResponse]
$creadList :: ReadS [DeleteManagedEndpointResponse]
readsPrec :: Int -> ReadS DeleteManagedEndpointResponse
$creadsPrec :: Int -> ReadS DeleteManagedEndpointResponse
Prelude.Read, Int -> DeleteManagedEndpointResponse -> ShowS
[DeleteManagedEndpointResponse] -> ShowS
DeleteManagedEndpointResponse -> String
(Int -> DeleteManagedEndpointResponse -> ShowS)
-> (DeleteManagedEndpointResponse -> String)
-> ([DeleteManagedEndpointResponse] -> ShowS)
-> Show DeleteManagedEndpointResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteManagedEndpointResponse] -> ShowS
$cshowList :: [DeleteManagedEndpointResponse] -> ShowS
show :: DeleteManagedEndpointResponse -> String
$cshow :: DeleteManagedEndpointResponse -> String
showsPrec :: Int -> DeleteManagedEndpointResponse -> ShowS
$cshowsPrec :: Int -> DeleteManagedEndpointResponse -> ShowS
Prelude.Show, (forall x.
DeleteManagedEndpointResponse
-> Rep DeleteManagedEndpointResponse x)
-> (forall x.
Rep DeleteManagedEndpointResponse x
-> DeleteManagedEndpointResponse)
-> Generic DeleteManagedEndpointResponse
forall x.
Rep DeleteManagedEndpointResponse x
-> DeleteManagedEndpointResponse
forall x.
DeleteManagedEndpointResponse
-> Rep DeleteManagedEndpointResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteManagedEndpointResponse x
-> DeleteManagedEndpointResponse
$cfrom :: forall x.
DeleteManagedEndpointResponse
-> Rep DeleteManagedEndpointResponse x
Prelude.Generic)
newDeleteManagedEndpointResponse ::
Prelude.Int ->
DeleteManagedEndpointResponse
newDeleteManagedEndpointResponse :: Int -> DeleteManagedEndpointResponse
newDeleteManagedEndpointResponse Int
pHttpStatus_ =
DeleteManagedEndpointResponse' :: Maybe Text -> Maybe Text -> Int -> DeleteManagedEndpointResponse
DeleteManagedEndpointResponse'
{ $sel:id:DeleteManagedEndpointResponse' :: Maybe Text
id =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:virtualClusterId:DeleteManagedEndpointResponse' :: Maybe Text
virtualClusterId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteManagedEndpointResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteManagedEndpointResponse_id :: Lens.Lens' DeleteManagedEndpointResponse (Prelude.Maybe Prelude.Text)
deleteManagedEndpointResponse_id :: (Maybe Text -> f (Maybe Text))
-> DeleteManagedEndpointResponse -> f DeleteManagedEndpointResponse
deleteManagedEndpointResponse_id = (DeleteManagedEndpointResponse -> Maybe Text)
-> (DeleteManagedEndpointResponse
-> Maybe Text -> DeleteManagedEndpointResponse)
-> Lens
DeleteManagedEndpointResponse
DeleteManagedEndpointResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteManagedEndpointResponse' {Maybe Text
id :: Maybe Text
$sel:id:DeleteManagedEndpointResponse' :: DeleteManagedEndpointResponse -> Maybe Text
id} -> Maybe Text
id) (\s :: DeleteManagedEndpointResponse
s@DeleteManagedEndpointResponse' {} Maybe Text
a -> DeleteManagedEndpointResponse
s {$sel:id:DeleteManagedEndpointResponse' :: Maybe Text
id = Maybe Text
a} :: DeleteManagedEndpointResponse)
deleteManagedEndpointResponse_virtualClusterId :: Lens.Lens' DeleteManagedEndpointResponse (Prelude.Maybe Prelude.Text)
deleteManagedEndpointResponse_virtualClusterId :: (Maybe Text -> f (Maybe Text))
-> DeleteManagedEndpointResponse -> f DeleteManagedEndpointResponse
deleteManagedEndpointResponse_virtualClusterId = (DeleteManagedEndpointResponse -> Maybe Text)
-> (DeleteManagedEndpointResponse
-> Maybe Text -> DeleteManagedEndpointResponse)
-> Lens
DeleteManagedEndpointResponse
DeleteManagedEndpointResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteManagedEndpointResponse' {Maybe Text
virtualClusterId :: Maybe Text
$sel:virtualClusterId:DeleteManagedEndpointResponse' :: DeleteManagedEndpointResponse -> Maybe Text
virtualClusterId} -> Maybe Text
virtualClusterId) (\s :: DeleteManagedEndpointResponse
s@DeleteManagedEndpointResponse' {} Maybe Text
a -> DeleteManagedEndpointResponse
s {$sel:virtualClusterId:DeleteManagedEndpointResponse' :: Maybe Text
virtualClusterId = Maybe Text
a} :: DeleteManagedEndpointResponse)
deleteManagedEndpointResponse_httpStatus :: Lens.Lens' DeleteManagedEndpointResponse Prelude.Int
deleteManagedEndpointResponse_httpStatus :: (Int -> f Int)
-> DeleteManagedEndpointResponse -> f DeleteManagedEndpointResponse
deleteManagedEndpointResponse_httpStatus = (DeleteManagedEndpointResponse -> Int)
-> (DeleteManagedEndpointResponse
-> Int -> DeleteManagedEndpointResponse)
-> Lens
DeleteManagedEndpointResponse DeleteManagedEndpointResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteManagedEndpointResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteManagedEndpointResponse' :: DeleteManagedEndpointResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteManagedEndpointResponse
s@DeleteManagedEndpointResponse' {} Int
a -> DeleteManagedEndpointResponse
s {$sel:httpStatus:DeleteManagedEndpointResponse' :: Int
httpStatus = Int
a} :: DeleteManagedEndpointResponse)
instance Prelude.NFData DeleteManagedEndpointResponse