{-# 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.DeregisterResource
(
DeregisterResource (..),
newDeregisterResource,
deregisterResource_resourceArn,
DeregisterResourceResponse (..),
newDeregisterResourceResponse,
deregisterResourceResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.LakeFormation.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 DeregisterResource = DeregisterResource'
{
DeregisterResource -> Text
resourceArn :: Prelude.Text
}
deriving (DeregisterResource -> DeregisterResource -> Bool
(DeregisterResource -> DeregisterResource -> Bool)
-> (DeregisterResource -> DeregisterResource -> Bool)
-> Eq DeregisterResource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeregisterResource -> DeregisterResource -> Bool
$c/= :: DeregisterResource -> DeregisterResource -> Bool
== :: DeregisterResource -> DeregisterResource -> Bool
$c== :: DeregisterResource -> DeregisterResource -> Bool
Prelude.Eq, ReadPrec [DeregisterResource]
ReadPrec DeregisterResource
Int -> ReadS DeregisterResource
ReadS [DeregisterResource]
(Int -> ReadS DeregisterResource)
-> ReadS [DeregisterResource]
-> ReadPrec DeregisterResource
-> ReadPrec [DeregisterResource]
-> Read DeregisterResource
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeregisterResource]
$creadListPrec :: ReadPrec [DeregisterResource]
readPrec :: ReadPrec DeregisterResource
$creadPrec :: ReadPrec DeregisterResource
readList :: ReadS [DeregisterResource]
$creadList :: ReadS [DeregisterResource]
readsPrec :: Int -> ReadS DeregisterResource
$creadsPrec :: Int -> ReadS DeregisterResource
Prelude.Read, Int -> DeregisterResource -> ShowS
[DeregisterResource] -> ShowS
DeregisterResource -> String
(Int -> DeregisterResource -> ShowS)
-> (DeregisterResource -> String)
-> ([DeregisterResource] -> ShowS)
-> Show DeregisterResource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeregisterResource] -> ShowS
$cshowList :: [DeregisterResource] -> ShowS
show :: DeregisterResource -> String
$cshow :: DeregisterResource -> String
showsPrec :: Int -> DeregisterResource -> ShowS
$cshowsPrec :: Int -> DeregisterResource -> ShowS
Prelude.Show, (forall x. DeregisterResource -> Rep DeregisterResource x)
-> (forall x. Rep DeregisterResource x -> DeregisterResource)
-> Generic DeregisterResource
forall x. Rep DeregisterResource x -> DeregisterResource
forall x. DeregisterResource -> Rep DeregisterResource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeregisterResource x -> DeregisterResource
$cfrom :: forall x. DeregisterResource -> Rep DeregisterResource x
Prelude.Generic)
newDeregisterResource ::
Prelude.Text ->
DeregisterResource
newDeregisterResource :: Text -> DeregisterResource
newDeregisterResource Text
pResourceArn_ =
DeregisterResource' :: Text -> DeregisterResource
DeregisterResource' {$sel:resourceArn:DeregisterResource' :: Text
resourceArn = Text
pResourceArn_}
deregisterResource_resourceArn :: Lens.Lens' DeregisterResource Prelude.Text
deregisterResource_resourceArn :: (Text -> f Text) -> DeregisterResource -> f DeregisterResource
deregisterResource_resourceArn = (DeregisterResource -> Text)
-> (DeregisterResource -> Text -> DeregisterResource)
-> Lens DeregisterResource DeregisterResource Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeregisterResource' {Text
resourceArn :: Text
$sel:resourceArn:DeregisterResource' :: DeregisterResource -> Text
resourceArn} -> Text
resourceArn) (\s :: DeregisterResource
s@DeregisterResource' {} Text
a -> DeregisterResource
s {$sel:resourceArn:DeregisterResource' :: Text
resourceArn = Text
a} :: DeregisterResource)
instance Core.AWSRequest DeregisterResource where
type
AWSResponse DeregisterResource =
DeregisterResourceResponse
request :: DeregisterResource -> Request DeregisterResource
request = Service -> DeregisterResource -> Request DeregisterResource
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeregisterResource
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeregisterResource)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeregisterResource))
-> Logger
-> Service
-> Proxy DeregisterResource
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeregisterResource)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> DeregisterResourceResponse
DeregisterResourceResponse'
(Int -> DeregisterResourceResponse)
-> Either String Int -> Either String DeregisterResourceResponse
forall (f :: * -> *) a b. Functor 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 DeregisterResource
instance Prelude.NFData DeregisterResource
instance Core.ToHeaders DeregisterResource where
toHeaders :: DeregisterResource -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeregisterResource -> 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
"AWSLakeFormation.DeregisterResource" ::
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 DeregisterResource where
toJSON :: DeregisterResource -> Value
toJSON DeregisterResource' {Text
resourceArn :: Text
$sel:resourceArn:DeregisterResource' :: DeregisterResource -> 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
"ResourceArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
resourceArn)]
)
instance Core.ToPath DeregisterResource where
toPath :: DeregisterResource -> ByteString
toPath = ByteString -> DeregisterResource -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeregisterResource where
toQuery :: DeregisterResource -> QueryString
toQuery = QueryString -> DeregisterResource -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeregisterResourceResponse = DeregisterResourceResponse'
{
DeregisterResourceResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeregisterResourceResponse -> DeregisterResourceResponse -> Bool
(DeregisterResourceResponse -> DeregisterResourceResponse -> Bool)
-> (DeregisterResourceResponse
-> DeregisterResourceResponse -> Bool)
-> Eq DeregisterResourceResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeregisterResourceResponse -> DeregisterResourceResponse -> Bool
$c/= :: DeregisterResourceResponse -> DeregisterResourceResponse -> Bool
== :: DeregisterResourceResponse -> DeregisterResourceResponse -> Bool
$c== :: DeregisterResourceResponse -> DeregisterResourceResponse -> Bool
Prelude.Eq, ReadPrec [DeregisterResourceResponse]
ReadPrec DeregisterResourceResponse
Int -> ReadS DeregisterResourceResponse
ReadS [DeregisterResourceResponse]
(Int -> ReadS DeregisterResourceResponse)
-> ReadS [DeregisterResourceResponse]
-> ReadPrec DeregisterResourceResponse
-> ReadPrec [DeregisterResourceResponse]
-> Read DeregisterResourceResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeregisterResourceResponse]
$creadListPrec :: ReadPrec [DeregisterResourceResponse]
readPrec :: ReadPrec DeregisterResourceResponse
$creadPrec :: ReadPrec DeregisterResourceResponse
readList :: ReadS [DeregisterResourceResponse]
$creadList :: ReadS [DeregisterResourceResponse]
readsPrec :: Int -> ReadS DeregisterResourceResponse
$creadsPrec :: Int -> ReadS DeregisterResourceResponse
Prelude.Read, Int -> DeregisterResourceResponse -> ShowS
[DeregisterResourceResponse] -> ShowS
DeregisterResourceResponse -> String
(Int -> DeregisterResourceResponse -> ShowS)
-> (DeregisterResourceResponse -> String)
-> ([DeregisterResourceResponse] -> ShowS)
-> Show DeregisterResourceResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeregisterResourceResponse] -> ShowS
$cshowList :: [DeregisterResourceResponse] -> ShowS
show :: DeregisterResourceResponse -> String
$cshow :: DeregisterResourceResponse -> String
showsPrec :: Int -> DeregisterResourceResponse -> ShowS
$cshowsPrec :: Int -> DeregisterResourceResponse -> ShowS
Prelude.Show, (forall x.
DeregisterResourceResponse -> Rep DeregisterResourceResponse x)
-> (forall x.
Rep DeregisterResourceResponse x -> DeregisterResourceResponse)
-> Generic DeregisterResourceResponse
forall x.
Rep DeregisterResourceResponse x -> DeregisterResourceResponse
forall x.
DeregisterResourceResponse -> Rep DeregisterResourceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeregisterResourceResponse x -> DeregisterResourceResponse
$cfrom :: forall x.
DeregisterResourceResponse -> Rep DeregisterResourceResponse x
Prelude.Generic)
newDeregisterResourceResponse ::
Prelude.Int ->
DeregisterResourceResponse
newDeregisterResourceResponse :: Int -> DeregisterResourceResponse
newDeregisterResourceResponse Int
pHttpStatus_ =
DeregisterResourceResponse' :: Int -> DeregisterResourceResponse
DeregisterResourceResponse'
{ $sel:httpStatus:DeregisterResourceResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deregisterResourceResponse_httpStatus :: Lens.Lens' DeregisterResourceResponse Prelude.Int
deregisterResourceResponse_httpStatus :: (Int -> f Int)
-> DeregisterResourceResponse -> f DeregisterResourceResponse
deregisterResourceResponse_httpStatus = (DeregisterResourceResponse -> Int)
-> (DeregisterResourceResponse
-> Int -> DeregisterResourceResponse)
-> Lens
DeregisterResourceResponse DeregisterResourceResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeregisterResourceResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeregisterResourceResponse' :: DeregisterResourceResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeregisterResourceResponse
s@DeregisterResourceResponse' {} Int
a -> DeregisterResourceResponse
s {$sel:httpStatus:DeregisterResourceResponse' :: Int
httpStatus = Int
a} :: DeregisterResourceResponse)
instance Prelude.NFData DeregisterResourceResponse