{-# 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.RedshiftServerLess.GetEndpointAccess
(
GetEndpointAccess (..),
newGetEndpointAccess,
getEndpointAccess_endpointName,
GetEndpointAccessResponse (..),
newGetEndpointAccessResponse,
getEndpointAccessResponse_endpoint,
getEndpointAccessResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.RedshiftServerLess.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data GetEndpointAccess = GetEndpointAccess'
{
GetEndpointAccess -> Text
endpointName :: Prelude.Text
}
deriving (GetEndpointAccess -> GetEndpointAccess -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetEndpointAccess -> GetEndpointAccess -> Bool
$c/= :: GetEndpointAccess -> GetEndpointAccess -> Bool
== :: GetEndpointAccess -> GetEndpointAccess -> Bool
$c== :: GetEndpointAccess -> GetEndpointAccess -> Bool
Prelude.Eq, ReadPrec [GetEndpointAccess]
ReadPrec GetEndpointAccess
Int -> ReadS GetEndpointAccess
ReadS [GetEndpointAccess]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetEndpointAccess]
$creadListPrec :: ReadPrec [GetEndpointAccess]
readPrec :: ReadPrec GetEndpointAccess
$creadPrec :: ReadPrec GetEndpointAccess
readList :: ReadS [GetEndpointAccess]
$creadList :: ReadS [GetEndpointAccess]
readsPrec :: Int -> ReadS GetEndpointAccess
$creadsPrec :: Int -> ReadS GetEndpointAccess
Prelude.Read, Int -> GetEndpointAccess -> ShowS
[GetEndpointAccess] -> ShowS
GetEndpointAccess -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetEndpointAccess] -> ShowS
$cshowList :: [GetEndpointAccess] -> ShowS
show :: GetEndpointAccess -> String
$cshow :: GetEndpointAccess -> String
showsPrec :: Int -> GetEndpointAccess -> ShowS
$cshowsPrec :: Int -> GetEndpointAccess -> ShowS
Prelude.Show, forall x. Rep GetEndpointAccess x -> GetEndpointAccess
forall x. GetEndpointAccess -> Rep GetEndpointAccess x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetEndpointAccess x -> GetEndpointAccess
$cfrom :: forall x. GetEndpointAccess -> Rep GetEndpointAccess x
Prelude.Generic)
newGetEndpointAccess ::
Prelude.Text ->
GetEndpointAccess
newGetEndpointAccess :: Text -> GetEndpointAccess
newGetEndpointAccess Text
pEndpointName_ =
GetEndpointAccess' {$sel:endpointName:GetEndpointAccess' :: Text
endpointName = Text
pEndpointName_}
getEndpointAccess_endpointName :: Lens.Lens' GetEndpointAccess Prelude.Text
getEndpointAccess_endpointName :: Lens' GetEndpointAccess Text
getEndpointAccess_endpointName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEndpointAccess' {Text
endpointName :: Text
$sel:endpointName:GetEndpointAccess' :: GetEndpointAccess -> Text
endpointName} -> Text
endpointName) (\s :: GetEndpointAccess
s@GetEndpointAccess' {} Text
a -> GetEndpointAccess
s {$sel:endpointName:GetEndpointAccess' :: Text
endpointName = Text
a} :: GetEndpointAccess)
instance Core.AWSRequest GetEndpointAccess where
type
AWSResponse GetEndpointAccess =
GetEndpointAccessResponse
request :: (Service -> Service)
-> GetEndpointAccess -> Request GetEndpointAccess
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetEndpointAccess
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetEndpointAccess)))
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 EndpointAccess -> Int -> GetEndpointAccessResponse
GetEndpointAccessResponse'
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 GetEndpointAccess where
hashWithSalt :: Int -> GetEndpointAccess -> Int
hashWithSalt Int
_salt GetEndpointAccess' {Text
endpointName :: Text
$sel:endpointName:GetEndpointAccess' :: GetEndpointAccess -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
endpointName
instance Prelude.NFData GetEndpointAccess where
rnf :: GetEndpointAccess -> ()
rnf GetEndpointAccess' {Text
endpointName :: Text
$sel:endpointName:GetEndpointAccess' :: GetEndpointAccess -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
endpointName
instance Data.ToHeaders GetEndpointAccess where
toHeaders :: GetEndpointAccess -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"RedshiftServerless.GetEndpointAccess" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON GetEndpointAccess where
toJSON :: GetEndpointAccess -> Value
toJSON GetEndpointAccess' {Text
endpointName :: Text
$sel:endpointName:GetEndpointAccess' :: GetEndpointAccess -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"endpointName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
endpointName)]
)
instance Data.ToPath GetEndpointAccess where
toPath :: GetEndpointAccess -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery GetEndpointAccess where
toQuery :: GetEndpointAccess -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data GetEndpointAccessResponse = GetEndpointAccessResponse'
{
GetEndpointAccessResponse -> Maybe EndpointAccess
endpoint :: Prelude.Maybe EndpointAccess,
GetEndpointAccessResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetEndpointAccessResponse -> GetEndpointAccessResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetEndpointAccessResponse -> GetEndpointAccessResponse -> Bool
$c/= :: GetEndpointAccessResponse -> GetEndpointAccessResponse -> Bool
== :: GetEndpointAccessResponse -> GetEndpointAccessResponse -> Bool
$c== :: GetEndpointAccessResponse -> GetEndpointAccessResponse -> Bool
Prelude.Eq, ReadPrec [GetEndpointAccessResponse]
ReadPrec GetEndpointAccessResponse
Int -> ReadS GetEndpointAccessResponse
ReadS [GetEndpointAccessResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetEndpointAccessResponse]
$creadListPrec :: ReadPrec [GetEndpointAccessResponse]
readPrec :: ReadPrec GetEndpointAccessResponse
$creadPrec :: ReadPrec GetEndpointAccessResponse
readList :: ReadS [GetEndpointAccessResponse]
$creadList :: ReadS [GetEndpointAccessResponse]
readsPrec :: Int -> ReadS GetEndpointAccessResponse
$creadsPrec :: Int -> ReadS GetEndpointAccessResponse
Prelude.Read, Int -> GetEndpointAccessResponse -> ShowS
[GetEndpointAccessResponse] -> ShowS
GetEndpointAccessResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetEndpointAccessResponse] -> ShowS
$cshowList :: [GetEndpointAccessResponse] -> ShowS
show :: GetEndpointAccessResponse -> String
$cshow :: GetEndpointAccessResponse -> String
showsPrec :: Int -> GetEndpointAccessResponse -> ShowS
$cshowsPrec :: Int -> GetEndpointAccessResponse -> ShowS
Prelude.Show, forall x.
Rep GetEndpointAccessResponse x -> GetEndpointAccessResponse
forall x.
GetEndpointAccessResponse -> Rep GetEndpointAccessResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetEndpointAccessResponse x -> GetEndpointAccessResponse
$cfrom :: forall x.
GetEndpointAccessResponse -> Rep GetEndpointAccessResponse x
Prelude.Generic)
newGetEndpointAccessResponse ::
Prelude.Int ->
GetEndpointAccessResponse
newGetEndpointAccessResponse :: Int -> GetEndpointAccessResponse
newGetEndpointAccessResponse Int
pHttpStatus_ =
GetEndpointAccessResponse'
{ $sel:endpoint:GetEndpointAccessResponse' :: Maybe EndpointAccess
endpoint =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetEndpointAccessResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getEndpointAccessResponse_endpoint :: Lens.Lens' GetEndpointAccessResponse (Prelude.Maybe EndpointAccess)
getEndpointAccessResponse_endpoint :: Lens' GetEndpointAccessResponse (Maybe EndpointAccess)
getEndpointAccessResponse_endpoint = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEndpointAccessResponse' {Maybe EndpointAccess
endpoint :: Maybe EndpointAccess
$sel:endpoint:GetEndpointAccessResponse' :: GetEndpointAccessResponse -> Maybe EndpointAccess
endpoint} -> Maybe EndpointAccess
endpoint) (\s :: GetEndpointAccessResponse
s@GetEndpointAccessResponse' {} Maybe EndpointAccess
a -> GetEndpointAccessResponse
s {$sel:endpoint:GetEndpointAccessResponse' :: Maybe EndpointAccess
endpoint = Maybe EndpointAccess
a} :: GetEndpointAccessResponse)
getEndpointAccessResponse_httpStatus :: Lens.Lens' GetEndpointAccessResponse Prelude.Int
getEndpointAccessResponse_httpStatus :: Lens' GetEndpointAccessResponse Int
getEndpointAccessResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEndpointAccessResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetEndpointAccessResponse' :: GetEndpointAccessResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetEndpointAccessResponse
s@GetEndpointAccessResponse' {} Int
a -> GetEndpointAccessResponse
s {$sel:httpStatus:GetEndpointAccessResponse' :: Int
httpStatus = Int
a} :: GetEndpointAccessResponse)
instance Prelude.NFData GetEndpointAccessResponse where
rnf :: GetEndpointAccessResponse -> ()
rnf GetEndpointAccessResponse' {Int
Maybe EndpointAccess
httpStatus :: Int
endpoint :: Maybe EndpointAccess
$sel:httpStatus:GetEndpointAccessResponse' :: GetEndpointAccessResponse -> Int
$sel:endpoint:GetEndpointAccessResponse' :: GetEndpointAccessResponse -> Maybe EndpointAccess
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe EndpointAccess
endpoint
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus