{-# 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.DescribeManagedEndpoint
(
DescribeManagedEndpoint (..),
newDescribeManagedEndpoint,
describeManagedEndpoint_id,
describeManagedEndpoint_virtualClusterId,
DescribeManagedEndpointResponse (..),
newDescribeManagedEndpointResponse,
describeManagedEndpointResponse_endpoint,
describeManagedEndpointResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EMRContainers.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DescribeManagedEndpoint = DescribeManagedEndpoint'
{
DescribeManagedEndpoint -> Text
id :: Prelude.Text,
DescribeManagedEndpoint -> Text
virtualClusterId :: Prelude.Text
}
deriving (DescribeManagedEndpoint -> DescribeManagedEndpoint -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeManagedEndpoint -> DescribeManagedEndpoint -> Bool
$c/= :: DescribeManagedEndpoint -> DescribeManagedEndpoint -> Bool
== :: DescribeManagedEndpoint -> DescribeManagedEndpoint -> Bool
$c== :: DescribeManagedEndpoint -> DescribeManagedEndpoint -> Bool
Prelude.Eq, ReadPrec [DescribeManagedEndpoint]
ReadPrec DescribeManagedEndpoint
Int -> ReadS DescribeManagedEndpoint
ReadS [DescribeManagedEndpoint]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeManagedEndpoint]
$creadListPrec :: ReadPrec [DescribeManagedEndpoint]
readPrec :: ReadPrec DescribeManagedEndpoint
$creadPrec :: ReadPrec DescribeManagedEndpoint
readList :: ReadS [DescribeManagedEndpoint]
$creadList :: ReadS [DescribeManagedEndpoint]
readsPrec :: Int -> ReadS DescribeManagedEndpoint
$creadsPrec :: Int -> ReadS DescribeManagedEndpoint
Prelude.Read, Int -> DescribeManagedEndpoint -> ShowS
[DescribeManagedEndpoint] -> ShowS
DescribeManagedEndpoint -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeManagedEndpoint] -> ShowS
$cshowList :: [DescribeManagedEndpoint] -> ShowS
show :: DescribeManagedEndpoint -> String
$cshow :: DescribeManagedEndpoint -> String
showsPrec :: Int -> DescribeManagedEndpoint -> ShowS
$cshowsPrec :: Int -> DescribeManagedEndpoint -> ShowS
Prelude.Show, forall x. Rep DescribeManagedEndpoint x -> DescribeManagedEndpoint
forall x. DescribeManagedEndpoint -> Rep DescribeManagedEndpoint x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeManagedEndpoint x -> DescribeManagedEndpoint
$cfrom :: forall x. DescribeManagedEndpoint -> Rep DescribeManagedEndpoint x
Prelude.Generic)
newDescribeManagedEndpoint ::
Prelude.Text ->
Prelude.Text ->
DescribeManagedEndpoint
newDescribeManagedEndpoint :: Text -> Text -> DescribeManagedEndpoint
newDescribeManagedEndpoint Text
pId_ Text
pVirtualClusterId_ =
DescribeManagedEndpoint'
{ $sel:id:DescribeManagedEndpoint' :: Text
id = Text
pId_,
$sel:virtualClusterId:DescribeManagedEndpoint' :: Text
virtualClusterId = Text
pVirtualClusterId_
}
describeManagedEndpoint_id :: Lens.Lens' DescribeManagedEndpoint Prelude.Text
describeManagedEndpoint_id :: Lens' DescribeManagedEndpoint Text
describeManagedEndpoint_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeManagedEndpoint' {Text
id :: Text
$sel:id:DescribeManagedEndpoint' :: DescribeManagedEndpoint -> Text
id} -> Text
id) (\s :: DescribeManagedEndpoint
s@DescribeManagedEndpoint' {} Text
a -> DescribeManagedEndpoint
s {$sel:id:DescribeManagedEndpoint' :: Text
id = Text
a} :: DescribeManagedEndpoint)
describeManagedEndpoint_virtualClusterId :: Lens.Lens' DescribeManagedEndpoint Prelude.Text
describeManagedEndpoint_virtualClusterId :: Lens' DescribeManagedEndpoint Text
describeManagedEndpoint_virtualClusterId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeManagedEndpoint' {Text
virtualClusterId :: Text
$sel:virtualClusterId:DescribeManagedEndpoint' :: DescribeManagedEndpoint -> Text
virtualClusterId} -> Text
virtualClusterId) (\s :: DescribeManagedEndpoint
s@DescribeManagedEndpoint' {} Text
a -> DescribeManagedEndpoint
s {$sel:virtualClusterId:DescribeManagedEndpoint' :: Text
virtualClusterId = Text
a} :: DescribeManagedEndpoint)
instance Core.AWSRequest DescribeManagedEndpoint where
type
AWSResponse DescribeManagedEndpoint =
DescribeManagedEndpointResponse
request :: (Service -> Service)
-> DescribeManagedEndpoint -> Request DescribeManagedEndpoint
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeManagedEndpoint
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeManagedEndpoint)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Endpoint -> Int -> DescribeManagedEndpointResponse
DescribeManagedEndpointResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"endpoint")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable DescribeManagedEndpoint where
hashWithSalt :: Int -> DescribeManagedEndpoint -> Int
hashWithSalt Int
_salt DescribeManagedEndpoint' {Text
virtualClusterId :: Text
id :: Text
$sel:virtualClusterId:DescribeManagedEndpoint' :: DescribeManagedEndpoint -> Text
$sel:id:DescribeManagedEndpoint' :: DescribeManagedEndpoint -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
id
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
virtualClusterId
instance Prelude.NFData DescribeManagedEndpoint where
rnf :: DescribeManagedEndpoint -> ()
rnf DescribeManagedEndpoint' {Text
virtualClusterId :: Text
id :: Text
$sel:virtualClusterId:DescribeManagedEndpoint' :: DescribeManagedEndpoint -> Text
$sel:id:DescribeManagedEndpoint' :: DescribeManagedEndpoint -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
id
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
virtualClusterId
instance Data.ToHeaders DescribeManagedEndpoint where
toHeaders :: DescribeManagedEndpoint -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToPath DescribeManagedEndpoint where
toPath :: DescribeManagedEndpoint -> ByteString
toPath DescribeManagedEndpoint' {Text
virtualClusterId :: Text
id :: Text
$sel:virtualClusterId:DescribeManagedEndpoint' :: DescribeManagedEndpoint -> Text
$sel:id:DescribeManagedEndpoint' :: DescribeManagedEndpoint -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/virtualclusters/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
virtualClusterId,
ByteString
"/endpoints/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
id
]
instance Data.ToQuery DescribeManagedEndpoint where
toQuery :: DescribeManagedEndpoint -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DescribeManagedEndpointResponse = DescribeManagedEndpointResponse'
{
DescribeManagedEndpointResponse -> Maybe Endpoint
endpoint :: Prelude.Maybe Endpoint,
DescribeManagedEndpointResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeManagedEndpointResponse
-> DescribeManagedEndpointResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeManagedEndpointResponse
-> DescribeManagedEndpointResponse -> Bool
$c/= :: DescribeManagedEndpointResponse
-> DescribeManagedEndpointResponse -> Bool
== :: DescribeManagedEndpointResponse
-> DescribeManagedEndpointResponse -> Bool
$c== :: DescribeManagedEndpointResponse
-> DescribeManagedEndpointResponse -> Bool
Prelude.Eq, Int -> DescribeManagedEndpointResponse -> ShowS
[DescribeManagedEndpointResponse] -> ShowS
DescribeManagedEndpointResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeManagedEndpointResponse] -> ShowS
$cshowList :: [DescribeManagedEndpointResponse] -> ShowS
show :: DescribeManagedEndpointResponse -> String
$cshow :: DescribeManagedEndpointResponse -> String
showsPrec :: Int -> DescribeManagedEndpointResponse -> ShowS
$cshowsPrec :: Int -> DescribeManagedEndpointResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeManagedEndpointResponse x
-> DescribeManagedEndpointResponse
forall x.
DescribeManagedEndpointResponse
-> Rep DescribeManagedEndpointResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeManagedEndpointResponse x
-> DescribeManagedEndpointResponse
$cfrom :: forall x.
DescribeManagedEndpointResponse
-> Rep DescribeManagedEndpointResponse x
Prelude.Generic)
newDescribeManagedEndpointResponse ::
Prelude.Int ->
DescribeManagedEndpointResponse
newDescribeManagedEndpointResponse :: Int -> DescribeManagedEndpointResponse
newDescribeManagedEndpointResponse Int
pHttpStatus_ =
DescribeManagedEndpointResponse'
{ $sel:endpoint:DescribeManagedEndpointResponse' :: Maybe Endpoint
endpoint =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeManagedEndpointResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeManagedEndpointResponse_endpoint :: Lens.Lens' DescribeManagedEndpointResponse (Prelude.Maybe Endpoint)
describeManagedEndpointResponse_endpoint :: Lens' DescribeManagedEndpointResponse (Maybe Endpoint)
describeManagedEndpointResponse_endpoint = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeManagedEndpointResponse' {Maybe Endpoint
endpoint :: Maybe Endpoint
$sel:endpoint:DescribeManagedEndpointResponse' :: DescribeManagedEndpointResponse -> Maybe Endpoint
endpoint} -> Maybe Endpoint
endpoint) (\s :: DescribeManagedEndpointResponse
s@DescribeManagedEndpointResponse' {} Maybe Endpoint
a -> DescribeManagedEndpointResponse
s {$sel:endpoint:DescribeManagedEndpointResponse' :: Maybe Endpoint
endpoint = Maybe Endpoint
a} :: DescribeManagedEndpointResponse)
describeManagedEndpointResponse_httpStatus :: Lens.Lens' DescribeManagedEndpointResponse Prelude.Int
describeManagedEndpointResponse_httpStatus :: Lens' DescribeManagedEndpointResponse Int
describeManagedEndpointResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeManagedEndpointResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeManagedEndpointResponse' :: DescribeManagedEndpointResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeManagedEndpointResponse
s@DescribeManagedEndpointResponse' {} Int
a -> DescribeManagedEndpointResponse
s {$sel:httpStatus:DescribeManagedEndpointResponse' :: Int
httpStatus = Int
a} :: DescribeManagedEndpointResponse)
instance
Prelude.NFData
DescribeManagedEndpointResponse
where
rnf :: DescribeManagedEndpointResponse -> ()
rnf DescribeManagedEndpointResponse' {Int
Maybe Endpoint
httpStatus :: Int
endpoint :: Maybe Endpoint
$sel:httpStatus:DescribeManagedEndpointResponse' :: DescribeManagedEndpointResponse -> Int
$sel:endpoint:DescribeManagedEndpointResponse' :: DescribeManagedEndpointResponse -> Maybe Endpoint
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Endpoint
endpoint
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus