{-# 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.RemoveLFTagsFromResource
(
RemoveLFTagsFromResource (..),
newRemoveLFTagsFromResource,
removeLFTagsFromResource_catalogId,
removeLFTagsFromResource_resource,
removeLFTagsFromResource_lFTags,
RemoveLFTagsFromResourceResponse (..),
newRemoveLFTagsFromResourceResponse,
removeLFTagsFromResourceResponse_failures,
removeLFTagsFromResourceResponse_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 RemoveLFTagsFromResource = RemoveLFTagsFromResource'
{
RemoveLFTagsFromResource -> Maybe Text
catalogId :: Prelude.Maybe Prelude.Text,
RemoveLFTagsFromResource -> Resource
resource :: Resource,
RemoveLFTagsFromResource -> NonEmpty LFTagPair
lFTags :: Prelude.NonEmpty LFTagPair
}
deriving (RemoveLFTagsFromResource -> RemoveLFTagsFromResource -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RemoveLFTagsFromResource -> RemoveLFTagsFromResource -> Bool
$c/= :: RemoveLFTagsFromResource -> RemoveLFTagsFromResource -> Bool
== :: RemoveLFTagsFromResource -> RemoveLFTagsFromResource -> Bool
$c== :: RemoveLFTagsFromResource -> RemoveLFTagsFromResource -> Bool
Prelude.Eq, ReadPrec [RemoveLFTagsFromResource]
ReadPrec RemoveLFTagsFromResource
Int -> ReadS RemoveLFTagsFromResource
ReadS [RemoveLFTagsFromResource]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RemoveLFTagsFromResource]
$creadListPrec :: ReadPrec [RemoveLFTagsFromResource]
readPrec :: ReadPrec RemoveLFTagsFromResource
$creadPrec :: ReadPrec RemoveLFTagsFromResource
readList :: ReadS [RemoveLFTagsFromResource]
$creadList :: ReadS [RemoveLFTagsFromResource]
readsPrec :: Int -> ReadS RemoveLFTagsFromResource
$creadsPrec :: Int -> ReadS RemoveLFTagsFromResource
Prelude.Read, Int -> RemoveLFTagsFromResource -> ShowS
[RemoveLFTagsFromResource] -> ShowS
RemoveLFTagsFromResource -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RemoveLFTagsFromResource] -> ShowS
$cshowList :: [RemoveLFTagsFromResource] -> ShowS
show :: RemoveLFTagsFromResource -> String
$cshow :: RemoveLFTagsFromResource -> String
showsPrec :: Int -> RemoveLFTagsFromResource -> ShowS
$cshowsPrec :: Int -> RemoveLFTagsFromResource -> ShowS
Prelude.Show, forall x.
Rep RemoveLFTagsFromResource x -> RemoveLFTagsFromResource
forall x.
RemoveLFTagsFromResource -> Rep RemoveLFTagsFromResource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RemoveLFTagsFromResource x -> RemoveLFTagsFromResource
$cfrom :: forall x.
RemoveLFTagsFromResource -> Rep RemoveLFTagsFromResource x
Prelude.Generic)
newRemoveLFTagsFromResource ::
Resource ->
Prelude.NonEmpty LFTagPair ->
RemoveLFTagsFromResource
newRemoveLFTagsFromResource :: Resource -> NonEmpty LFTagPair -> RemoveLFTagsFromResource
newRemoveLFTagsFromResource Resource
pResource_ NonEmpty LFTagPair
pLFTags_ =
RemoveLFTagsFromResource'
{ $sel:catalogId:RemoveLFTagsFromResource' :: Maybe Text
catalogId =
forall a. Maybe a
Prelude.Nothing,
$sel:resource:RemoveLFTagsFromResource' :: Resource
resource = Resource
pResource_,
$sel:lFTags:RemoveLFTagsFromResource' :: NonEmpty LFTagPair
lFTags = forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced forall t b. AReview t b -> b -> t
Lens.# NonEmpty LFTagPair
pLFTags_
}
removeLFTagsFromResource_catalogId :: Lens.Lens' RemoveLFTagsFromResource (Prelude.Maybe Prelude.Text)
removeLFTagsFromResource_catalogId :: Lens' RemoveLFTagsFromResource (Maybe Text)
removeLFTagsFromResource_catalogId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemoveLFTagsFromResource' {Maybe Text
catalogId :: Maybe Text
$sel:catalogId:RemoveLFTagsFromResource' :: RemoveLFTagsFromResource -> Maybe Text
catalogId} -> Maybe Text
catalogId) (\s :: RemoveLFTagsFromResource
s@RemoveLFTagsFromResource' {} Maybe Text
a -> RemoveLFTagsFromResource
s {$sel:catalogId:RemoveLFTagsFromResource' :: Maybe Text
catalogId = Maybe Text
a} :: RemoveLFTagsFromResource)
removeLFTagsFromResource_resource :: Lens.Lens' RemoveLFTagsFromResource Resource
removeLFTagsFromResource_resource :: Lens' RemoveLFTagsFromResource Resource
removeLFTagsFromResource_resource = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemoveLFTagsFromResource' {Resource
resource :: Resource
$sel:resource:RemoveLFTagsFromResource' :: RemoveLFTagsFromResource -> Resource
resource} -> Resource
resource) (\s :: RemoveLFTagsFromResource
s@RemoveLFTagsFromResource' {} Resource
a -> RemoveLFTagsFromResource
s {$sel:resource:RemoveLFTagsFromResource' :: Resource
resource = Resource
a} :: RemoveLFTagsFromResource)
removeLFTagsFromResource_lFTags :: Lens.Lens' RemoveLFTagsFromResource (Prelude.NonEmpty LFTagPair)
removeLFTagsFromResource_lFTags :: Lens' RemoveLFTagsFromResource (NonEmpty LFTagPair)
removeLFTagsFromResource_lFTags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemoveLFTagsFromResource' {NonEmpty LFTagPair
lFTags :: NonEmpty LFTagPair
$sel:lFTags:RemoveLFTagsFromResource' :: RemoveLFTagsFromResource -> NonEmpty LFTagPair
lFTags} -> NonEmpty LFTagPair
lFTags) (\s :: RemoveLFTagsFromResource
s@RemoveLFTagsFromResource' {} NonEmpty LFTagPair
a -> RemoveLFTagsFromResource
s {$sel:lFTags:RemoveLFTagsFromResource' :: NonEmpty LFTagPair
lFTags = NonEmpty LFTagPair
a} :: RemoveLFTagsFromResource) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest RemoveLFTagsFromResource where
type
AWSResponse RemoveLFTagsFromResource =
RemoveLFTagsFromResourceResponse
request :: (Service -> Service)
-> RemoveLFTagsFromResource -> Request RemoveLFTagsFromResource
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 RemoveLFTagsFromResource
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RemoveLFTagsFromResource)))
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 [LFTagError] -> Int -> RemoveLFTagsFromResourceResponse
RemoveLFTagsFromResourceResponse'
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
"Failures" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
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 RemoveLFTagsFromResource where
hashWithSalt :: Int -> RemoveLFTagsFromResource -> Int
hashWithSalt Int
_salt RemoveLFTagsFromResource' {Maybe Text
NonEmpty LFTagPair
Resource
lFTags :: NonEmpty LFTagPair
resource :: Resource
catalogId :: Maybe Text
$sel:lFTags:RemoveLFTagsFromResource' :: RemoveLFTagsFromResource -> NonEmpty LFTagPair
$sel:resource:RemoveLFTagsFromResource' :: RemoveLFTagsFromResource -> Resource
$sel:catalogId:RemoveLFTagsFromResource' :: RemoveLFTagsFromResource -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
catalogId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Resource
resource
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty LFTagPair
lFTags
instance Prelude.NFData RemoveLFTagsFromResource where
rnf :: RemoveLFTagsFromResource -> ()
rnf RemoveLFTagsFromResource' {Maybe Text
NonEmpty LFTagPair
Resource
lFTags :: NonEmpty LFTagPair
resource :: Resource
catalogId :: Maybe Text
$sel:lFTags:RemoveLFTagsFromResource' :: RemoveLFTagsFromResource -> NonEmpty LFTagPair
$sel:resource:RemoveLFTagsFromResource' :: RemoveLFTagsFromResource -> Resource
$sel:catalogId:RemoveLFTagsFromResource' :: RemoveLFTagsFromResource -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
catalogId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Resource
resource
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf NonEmpty LFTagPair
lFTags
instance Data.ToHeaders RemoveLFTagsFromResource where
toHeaders :: RemoveLFTagsFromResource -> 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 RemoveLFTagsFromResource where
toJSON :: RemoveLFTagsFromResource -> Value
toJSON RemoveLFTagsFromResource' {Maybe Text
NonEmpty LFTagPair
Resource
lFTags :: NonEmpty LFTagPair
resource :: Resource
catalogId :: Maybe Text
$sel:lFTags:RemoveLFTagsFromResource' :: RemoveLFTagsFromResource -> NonEmpty LFTagPair
$sel:resource:RemoveLFTagsFromResource' :: RemoveLFTagsFromResource -> Resource
$sel:catalogId:RemoveLFTagsFromResource' :: RemoveLFTagsFromResource -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"CatalogId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
catalogId,
forall a. a -> Maybe a
Prelude.Just (Key
"Resource" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Resource
resource),
forall a. a -> Maybe a
Prelude.Just (Key
"LFTags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= NonEmpty LFTagPair
lFTags)
]
)
instance Data.ToPath RemoveLFTagsFromResource where
toPath :: RemoveLFTagsFromResource -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/RemoveLFTagsFromResource"
instance Data.ToQuery RemoveLFTagsFromResource where
toQuery :: RemoveLFTagsFromResource -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data RemoveLFTagsFromResourceResponse = RemoveLFTagsFromResourceResponse'
{
RemoveLFTagsFromResourceResponse -> Maybe [LFTagError]
failures :: Prelude.Maybe [LFTagError],
RemoveLFTagsFromResourceResponse -> Int
httpStatus :: Prelude.Int
}
deriving (RemoveLFTagsFromResourceResponse
-> RemoveLFTagsFromResourceResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RemoveLFTagsFromResourceResponse
-> RemoveLFTagsFromResourceResponse -> Bool
$c/= :: RemoveLFTagsFromResourceResponse
-> RemoveLFTagsFromResourceResponse -> Bool
== :: RemoveLFTagsFromResourceResponse
-> RemoveLFTagsFromResourceResponse -> Bool
$c== :: RemoveLFTagsFromResourceResponse
-> RemoveLFTagsFromResourceResponse -> Bool
Prelude.Eq, ReadPrec [RemoveLFTagsFromResourceResponse]
ReadPrec RemoveLFTagsFromResourceResponse
Int -> ReadS RemoveLFTagsFromResourceResponse
ReadS [RemoveLFTagsFromResourceResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RemoveLFTagsFromResourceResponse]
$creadListPrec :: ReadPrec [RemoveLFTagsFromResourceResponse]
readPrec :: ReadPrec RemoveLFTagsFromResourceResponse
$creadPrec :: ReadPrec RemoveLFTagsFromResourceResponse
readList :: ReadS [RemoveLFTagsFromResourceResponse]
$creadList :: ReadS [RemoveLFTagsFromResourceResponse]
readsPrec :: Int -> ReadS RemoveLFTagsFromResourceResponse
$creadsPrec :: Int -> ReadS RemoveLFTagsFromResourceResponse
Prelude.Read, Int -> RemoveLFTagsFromResourceResponse -> ShowS
[RemoveLFTagsFromResourceResponse] -> ShowS
RemoveLFTagsFromResourceResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RemoveLFTagsFromResourceResponse] -> ShowS
$cshowList :: [RemoveLFTagsFromResourceResponse] -> ShowS
show :: RemoveLFTagsFromResourceResponse -> String
$cshow :: RemoveLFTagsFromResourceResponse -> String
showsPrec :: Int -> RemoveLFTagsFromResourceResponse -> ShowS
$cshowsPrec :: Int -> RemoveLFTagsFromResourceResponse -> ShowS
Prelude.Show, forall x.
Rep RemoveLFTagsFromResourceResponse x
-> RemoveLFTagsFromResourceResponse
forall x.
RemoveLFTagsFromResourceResponse
-> Rep RemoveLFTagsFromResourceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RemoveLFTagsFromResourceResponse x
-> RemoveLFTagsFromResourceResponse
$cfrom :: forall x.
RemoveLFTagsFromResourceResponse
-> Rep RemoveLFTagsFromResourceResponse x
Prelude.Generic)
newRemoveLFTagsFromResourceResponse ::
Prelude.Int ->
RemoveLFTagsFromResourceResponse
newRemoveLFTagsFromResourceResponse :: Int -> RemoveLFTagsFromResourceResponse
newRemoveLFTagsFromResourceResponse Int
pHttpStatus_ =
RemoveLFTagsFromResourceResponse'
{ $sel:failures:RemoveLFTagsFromResourceResponse' :: Maybe [LFTagError]
failures =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:RemoveLFTagsFromResourceResponse' :: Int
httpStatus = Int
pHttpStatus_
}
removeLFTagsFromResourceResponse_failures :: Lens.Lens' RemoveLFTagsFromResourceResponse (Prelude.Maybe [LFTagError])
removeLFTagsFromResourceResponse_failures :: Lens' RemoveLFTagsFromResourceResponse (Maybe [LFTagError])
removeLFTagsFromResourceResponse_failures = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemoveLFTagsFromResourceResponse' {Maybe [LFTagError]
failures :: Maybe [LFTagError]
$sel:failures:RemoveLFTagsFromResourceResponse' :: RemoveLFTagsFromResourceResponse -> Maybe [LFTagError]
failures} -> Maybe [LFTagError]
failures) (\s :: RemoveLFTagsFromResourceResponse
s@RemoveLFTagsFromResourceResponse' {} Maybe [LFTagError]
a -> RemoveLFTagsFromResourceResponse
s {$sel:failures:RemoveLFTagsFromResourceResponse' :: Maybe [LFTagError]
failures = Maybe [LFTagError]
a} :: RemoveLFTagsFromResourceResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
removeLFTagsFromResourceResponse_httpStatus :: Lens.Lens' RemoveLFTagsFromResourceResponse Prelude.Int
removeLFTagsFromResourceResponse_httpStatus :: Lens' RemoveLFTagsFromResourceResponse Int
removeLFTagsFromResourceResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemoveLFTagsFromResourceResponse' {Int
httpStatus :: Int
$sel:httpStatus:RemoveLFTagsFromResourceResponse' :: RemoveLFTagsFromResourceResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: RemoveLFTagsFromResourceResponse
s@RemoveLFTagsFromResourceResponse' {} Int
a -> RemoveLFTagsFromResourceResponse
s {$sel:httpStatus:RemoveLFTagsFromResourceResponse' :: Int
httpStatus = Int
a} :: RemoveLFTagsFromResourceResponse)
instance
Prelude.NFData
RemoveLFTagsFromResourceResponse
where
rnf :: RemoveLFTagsFromResourceResponse -> ()
rnf RemoveLFTagsFromResourceResponse' {Int
Maybe [LFTagError]
httpStatus :: Int
failures :: Maybe [LFTagError]
$sel:httpStatus:RemoveLFTagsFromResourceResponse' :: RemoveLFTagsFromResourceResponse -> Int
$sel:failures:RemoveLFTagsFromResourceResponse' :: RemoveLFTagsFromResourceResponse -> Maybe [LFTagError]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [LFTagError]
failures
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus