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