{-# 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.LakeFormation.DescribeResource
(
DescribeResource (..),
newDescribeResource,
describeResource_resourceArn,
DescribeResourceResponse (..),
newDescribeResourceResponse,
describeResourceResponse_resourceInfo,
describeResourceResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.LakeFormation.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DescribeResource = DescribeResource'
{
DescribeResource -> Text
resourceArn :: Prelude.Text
}
deriving (DescribeResource -> DescribeResource -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeResource -> DescribeResource -> Bool
$c/= :: DescribeResource -> DescribeResource -> Bool
== :: DescribeResource -> DescribeResource -> Bool
$c== :: DescribeResource -> DescribeResource -> Bool
Prelude.Eq, ReadPrec [DescribeResource]
ReadPrec DescribeResource
Int -> ReadS DescribeResource
ReadS [DescribeResource]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeResource]
$creadListPrec :: ReadPrec [DescribeResource]
readPrec :: ReadPrec DescribeResource
$creadPrec :: ReadPrec DescribeResource
readList :: ReadS [DescribeResource]
$creadList :: ReadS [DescribeResource]
readsPrec :: Int -> ReadS DescribeResource
$creadsPrec :: Int -> ReadS DescribeResource
Prelude.Read, Int -> DescribeResource -> ShowS
[DescribeResource] -> ShowS
DescribeResource -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeResource] -> ShowS
$cshowList :: [DescribeResource] -> ShowS
show :: DescribeResource -> String
$cshow :: DescribeResource -> String
showsPrec :: Int -> DescribeResource -> ShowS
$cshowsPrec :: Int -> DescribeResource -> ShowS
Prelude.Show, forall x. Rep DescribeResource x -> DescribeResource
forall x. DescribeResource -> Rep DescribeResource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeResource x -> DescribeResource
$cfrom :: forall x. DescribeResource -> Rep DescribeResource x
Prelude.Generic)
newDescribeResource ::
Prelude.Text ->
DescribeResource
newDescribeResource :: Text -> DescribeResource
newDescribeResource Text
pResourceArn_ =
DescribeResource' {$sel:resourceArn:DescribeResource' :: Text
resourceArn = Text
pResourceArn_}
describeResource_resourceArn :: Lens.Lens' DescribeResource Prelude.Text
describeResource_resourceArn :: Lens' DescribeResource Text
describeResource_resourceArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeResource' {Text
resourceArn :: Text
$sel:resourceArn:DescribeResource' :: DescribeResource -> Text
resourceArn} -> Text
resourceArn) (\s :: DescribeResource
s@DescribeResource' {} Text
a -> DescribeResource
s {$sel:resourceArn:DescribeResource' :: Text
resourceArn = Text
a} :: DescribeResource)
instance Core.AWSRequest DescribeResource where
type
AWSResponse DescribeResource =
DescribeResourceResponse
request :: (Service -> Service)
-> DescribeResource -> Request DescribeResource
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 DescribeResource
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeResource)))
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 ResourceInfo -> Int -> DescribeResourceResponse
DescribeResourceResponse'
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
"ResourceInfo")
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 DescribeResource where
hashWithSalt :: Int -> DescribeResource -> Int
hashWithSalt Int
_salt DescribeResource' {Text
resourceArn :: Text
$sel:resourceArn:DescribeResource' :: DescribeResource -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
resourceArn
instance Prelude.NFData DescribeResource where
rnf :: DescribeResource -> ()
rnf DescribeResource' {Text
resourceArn :: Text
$sel:resourceArn:DescribeResource' :: DescribeResource -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
resourceArn
instance Data.ToHeaders DescribeResource where
toHeaders :: DescribeResource -> 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.ToJSON DescribeResource where
toJSON :: DescribeResource -> Value
toJSON DescribeResource' {Text
resourceArn :: Text
$sel:resourceArn:DescribeResource' :: DescribeResource -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"ResourceArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
resourceArn)]
)
instance Data.ToPath DescribeResource where
toPath :: DescribeResource -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/DescribeResource"
instance Data.ToQuery DescribeResource where
toQuery :: DescribeResource -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DescribeResourceResponse = DescribeResourceResponse'
{
DescribeResourceResponse -> Maybe ResourceInfo
resourceInfo :: Prelude.Maybe ResourceInfo,
DescribeResourceResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeResourceResponse -> DescribeResourceResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeResourceResponse -> DescribeResourceResponse -> Bool
$c/= :: DescribeResourceResponse -> DescribeResourceResponse -> Bool
== :: DescribeResourceResponse -> DescribeResourceResponse -> Bool
$c== :: DescribeResourceResponse -> DescribeResourceResponse -> Bool
Prelude.Eq, ReadPrec [DescribeResourceResponse]
ReadPrec DescribeResourceResponse
Int -> ReadS DescribeResourceResponse
ReadS [DescribeResourceResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeResourceResponse]
$creadListPrec :: ReadPrec [DescribeResourceResponse]
readPrec :: ReadPrec DescribeResourceResponse
$creadPrec :: ReadPrec DescribeResourceResponse
readList :: ReadS [DescribeResourceResponse]
$creadList :: ReadS [DescribeResourceResponse]
readsPrec :: Int -> ReadS DescribeResourceResponse
$creadsPrec :: Int -> ReadS DescribeResourceResponse
Prelude.Read, Int -> DescribeResourceResponse -> ShowS
[DescribeResourceResponse] -> ShowS
DescribeResourceResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeResourceResponse] -> ShowS
$cshowList :: [DescribeResourceResponse] -> ShowS
show :: DescribeResourceResponse -> String
$cshow :: DescribeResourceResponse -> String
showsPrec :: Int -> DescribeResourceResponse -> ShowS
$cshowsPrec :: Int -> DescribeResourceResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeResourceResponse x -> DescribeResourceResponse
forall x.
DescribeResourceResponse -> Rep DescribeResourceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeResourceResponse x -> DescribeResourceResponse
$cfrom :: forall x.
DescribeResourceResponse -> Rep DescribeResourceResponse x
Prelude.Generic)
newDescribeResourceResponse ::
Prelude.Int ->
DescribeResourceResponse
newDescribeResourceResponse :: Int -> DescribeResourceResponse
newDescribeResourceResponse Int
pHttpStatus_ =
DescribeResourceResponse'
{ $sel:resourceInfo:DescribeResourceResponse' :: Maybe ResourceInfo
resourceInfo =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeResourceResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeResourceResponse_resourceInfo :: Lens.Lens' DescribeResourceResponse (Prelude.Maybe ResourceInfo)
describeResourceResponse_resourceInfo :: Lens' DescribeResourceResponse (Maybe ResourceInfo)
describeResourceResponse_resourceInfo = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeResourceResponse' {Maybe ResourceInfo
resourceInfo :: Maybe ResourceInfo
$sel:resourceInfo:DescribeResourceResponse' :: DescribeResourceResponse -> Maybe ResourceInfo
resourceInfo} -> Maybe ResourceInfo
resourceInfo) (\s :: DescribeResourceResponse
s@DescribeResourceResponse' {} Maybe ResourceInfo
a -> DescribeResourceResponse
s {$sel:resourceInfo:DescribeResourceResponse' :: Maybe ResourceInfo
resourceInfo = Maybe ResourceInfo
a} :: DescribeResourceResponse)
describeResourceResponse_httpStatus :: Lens.Lens' DescribeResourceResponse Prelude.Int
describeResourceResponse_httpStatus :: Lens' DescribeResourceResponse Int
describeResourceResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeResourceResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeResourceResponse' :: DescribeResourceResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeResourceResponse
s@DescribeResourceResponse' {} Int
a -> DescribeResourceResponse
s {$sel:httpStatus:DescribeResourceResponse' :: Int
httpStatus = Int
a} :: DescribeResourceResponse)
instance Prelude.NFData DescribeResourceResponse where
rnf :: DescribeResourceResponse -> ()
rnf DescribeResourceResponse' {Int
Maybe ResourceInfo
httpStatus :: Int
resourceInfo :: Maybe ResourceInfo
$sel:httpStatus:DescribeResourceResponse' :: DescribeResourceResponse -> Int
$sel:resourceInfo:DescribeResourceResponse' :: DescribeResourceResponse -> Maybe ResourceInfo
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe ResourceInfo
resourceInfo
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus