{-# 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.UpdateLFTag
(
UpdateLFTag (..),
newUpdateLFTag,
updateLFTag_catalogId,
updateLFTag_tagValuesToAdd,
updateLFTag_tagValuesToDelete,
updateLFTag_tagKey,
UpdateLFTagResponse (..),
newUpdateLFTagResponse,
updateLFTagResponse_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 UpdateLFTag = UpdateLFTag'
{
UpdateLFTag -> Maybe Text
catalogId :: Prelude.Maybe Prelude.Text,
UpdateLFTag -> Maybe (NonEmpty Text)
tagValuesToAdd :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
UpdateLFTag -> Maybe (NonEmpty Text)
tagValuesToDelete :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
UpdateLFTag -> Text
tagKey :: Prelude.Text
}
deriving (UpdateLFTag -> UpdateLFTag -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateLFTag -> UpdateLFTag -> Bool
$c/= :: UpdateLFTag -> UpdateLFTag -> Bool
== :: UpdateLFTag -> UpdateLFTag -> Bool
$c== :: UpdateLFTag -> UpdateLFTag -> Bool
Prelude.Eq, ReadPrec [UpdateLFTag]
ReadPrec UpdateLFTag
Int -> ReadS UpdateLFTag
ReadS [UpdateLFTag]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateLFTag]
$creadListPrec :: ReadPrec [UpdateLFTag]
readPrec :: ReadPrec UpdateLFTag
$creadPrec :: ReadPrec UpdateLFTag
readList :: ReadS [UpdateLFTag]
$creadList :: ReadS [UpdateLFTag]
readsPrec :: Int -> ReadS UpdateLFTag
$creadsPrec :: Int -> ReadS UpdateLFTag
Prelude.Read, Int -> UpdateLFTag -> ShowS
[UpdateLFTag] -> ShowS
UpdateLFTag -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateLFTag] -> ShowS
$cshowList :: [UpdateLFTag] -> ShowS
show :: UpdateLFTag -> String
$cshow :: UpdateLFTag -> String
showsPrec :: Int -> UpdateLFTag -> ShowS
$cshowsPrec :: Int -> UpdateLFTag -> ShowS
Prelude.Show, forall x. Rep UpdateLFTag x -> UpdateLFTag
forall x. UpdateLFTag -> Rep UpdateLFTag x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateLFTag x -> UpdateLFTag
$cfrom :: forall x. UpdateLFTag -> Rep UpdateLFTag x
Prelude.Generic)
newUpdateLFTag ::
Prelude.Text ->
UpdateLFTag
newUpdateLFTag :: Text -> UpdateLFTag
newUpdateLFTag Text
pTagKey_ =
UpdateLFTag'
{ $sel:catalogId:UpdateLFTag' :: Maybe Text
catalogId = forall a. Maybe a
Prelude.Nothing,
$sel:tagValuesToAdd:UpdateLFTag' :: Maybe (NonEmpty Text)
tagValuesToAdd = forall a. Maybe a
Prelude.Nothing,
$sel:tagValuesToDelete:UpdateLFTag' :: Maybe (NonEmpty Text)
tagValuesToDelete = forall a. Maybe a
Prelude.Nothing,
$sel:tagKey:UpdateLFTag' :: Text
tagKey = Text
pTagKey_
}
updateLFTag_catalogId :: Lens.Lens' UpdateLFTag (Prelude.Maybe Prelude.Text)
updateLFTag_catalogId :: Lens' UpdateLFTag (Maybe Text)
updateLFTag_catalogId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLFTag' {Maybe Text
catalogId :: Maybe Text
$sel:catalogId:UpdateLFTag' :: UpdateLFTag -> Maybe Text
catalogId} -> Maybe Text
catalogId) (\s :: UpdateLFTag
s@UpdateLFTag' {} Maybe Text
a -> UpdateLFTag
s {$sel:catalogId:UpdateLFTag' :: Maybe Text
catalogId = Maybe Text
a} :: UpdateLFTag)
updateLFTag_tagValuesToAdd :: Lens.Lens' UpdateLFTag (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
updateLFTag_tagValuesToAdd :: Lens' UpdateLFTag (Maybe (NonEmpty Text))
updateLFTag_tagValuesToAdd = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLFTag' {Maybe (NonEmpty Text)
tagValuesToAdd :: Maybe (NonEmpty Text)
$sel:tagValuesToAdd:UpdateLFTag' :: UpdateLFTag -> Maybe (NonEmpty Text)
tagValuesToAdd} -> Maybe (NonEmpty Text)
tagValuesToAdd) (\s :: UpdateLFTag
s@UpdateLFTag' {} Maybe (NonEmpty Text)
a -> UpdateLFTag
s {$sel:tagValuesToAdd:UpdateLFTag' :: Maybe (NonEmpty Text)
tagValuesToAdd = Maybe (NonEmpty Text)
a} :: UpdateLFTag) 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
updateLFTag_tagValuesToDelete :: Lens.Lens' UpdateLFTag (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
updateLFTag_tagValuesToDelete :: Lens' UpdateLFTag (Maybe (NonEmpty Text))
updateLFTag_tagValuesToDelete = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLFTag' {Maybe (NonEmpty Text)
tagValuesToDelete :: Maybe (NonEmpty Text)
$sel:tagValuesToDelete:UpdateLFTag' :: UpdateLFTag -> Maybe (NonEmpty Text)
tagValuesToDelete} -> Maybe (NonEmpty Text)
tagValuesToDelete) (\s :: UpdateLFTag
s@UpdateLFTag' {} Maybe (NonEmpty Text)
a -> UpdateLFTag
s {$sel:tagValuesToDelete:UpdateLFTag' :: Maybe (NonEmpty Text)
tagValuesToDelete = Maybe (NonEmpty Text)
a} :: UpdateLFTag) 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
updateLFTag_tagKey :: Lens.Lens' UpdateLFTag Prelude.Text
updateLFTag_tagKey :: Lens' UpdateLFTag Text
updateLFTag_tagKey = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLFTag' {Text
tagKey :: Text
$sel:tagKey:UpdateLFTag' :: UpdateLFTag -> Text
tagKey} -> Text
tagKey) (\s :: UpdateLFTag
s@UpdateLFTag' {} Text
a -> UpdateLFTag
s {$sel:tagKey:UpdateLFTag' :: Text
tagKey = Text
a} :: UpdateLFTag)
instance Core.AWSRequest UpdateLFTag where
type AWSResponse UpdateLFTag = UpdateLFTagResponse
request :: (Service -> Service) -> UpdateLFTag -> Request UpdateLFTag
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 UpdateLFTag
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateLFTag)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> UpdateLFTagResponse
UpdateLFTagResponse'
forall (f :: * -> *) a b. Functor 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 UpdateLFTag where
hashWithSalt :: Int -> UpdateLFTag -> Int
hashWithSalt Int
_salt UpdateLFTag' {Maybe (NonEmpty Text)
Maybe Text
Text
tagKey :: Text
tagValuesToDelete :: Maybe (NonEmpty Text)
tagValuesToAdd :: Maybe (NonEmpty Text)
catalogId :: Maybe Text
$sel:tagKey:UpdateLFTag' :: UpdateLFTag -> Text
$sel:tagValuesToDelete:UpdateLFTag' :: UpdateLFTag -> Maybe (NonEmpty Text)
$sel:tagValuesToAdd:UpdateLFTag' :: UpdateLFTag -> Maybe (NonEmpty Text)
$sel:catalogId:UpdateLFTag' :: UpdateLFTag -> 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` Maybe (NonEmpty Text)
tagValuesToAdd
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Text)
tagValuesToDelete
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
tagKey
instance Prelude.NFData UpdateLFTag where
rnf :: UpdateLFTag -> ()
rnf UpdateLFTag' {Maybe (NonEmpty Text)
Maybe Text
Text
tagKey :: Text
tagValuesToDelete :: Maybe (NonEmpty Text)
tagValuesToAdd :: Maybe (NonEmpty Text)
catalogId :: Maybe Text
$sel:tagKey:UpdateLFTag' :: UpdateLFTag -> Text
$sel:tagValuesToDelete:UpdateLFTag' :: UpdateLFTag -> Maybe (NonEmpty Text)
$sel:tagValuesToAdd:UpdateLFTag' :: UpdateLFTag -> Maybe (NonEmpty Text)
$sel:catalogId:UpdateLFTag' :: UpdateLFTag -> 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 Maybe (NonEmpty Text)
tagValuesToAdd
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Text)
tagValuesToDelete
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
tagKey
instance Data.ToHeaders UpdateLFTag where
toHeaders :: UpdateLFTag -> 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 UpdateLFTag where
toJSON :: UpdateLFTag -> Value
toJSON UpdateLFTag' {Maybe (NonEmpty Text)
Maybe Text
Text
tagKey :: Text
tagValuesToDelete :: Maybe (NonEmpty Text)
tagValuesToAdd :: Maybe (NonEmpty Text)
catalogId :: Maybe Text
$sel:tagKey:UpdateLFTag' :: UpdateLFTag -> Text
$sel:tagValuesToDelete:UpdateLFTag' :: UpdateLFTag -> Maybe (NonEmpty Text)
$sel:tagValuesToAdd:UpdateLFTag' :: UpdateLFTag -> Maybe (NonEmpty Text)
$sel:catalogId:UpdateLFTag' :: UpdateLFTag -> 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,
(Key
"TagValuesToAdd" 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 (NonEmpty Text)
tagValuesToAdd,
(Key
"TagValuesToDelete" 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 (NonEmpty Text)
tagValuesToDelete,
forall a. a -> Maybe a
Prelude.Just (Key
"TagKey" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
tagKey)
]
)
instance Data.ToPath UpdateLFTag where
toPath :: UpdateLFTag -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/UpdateLFTag"
instance Data.ToQuery UpdateLFTag where
toQuery :: UpdateLFTag -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdateLFTagResponse = UpdateLFTagResponse'
{
UpdateLFTagResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateLFTagResponse -> UpdateLFTagResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateLFTagResponse -> UpdateLFTagResponse -> Bool
$c/= :: UpdateLFTagResponse -> UpdateLFTagResponse -> Bool
== :: UpdateLFTagResponse -> UpdateLFTagResponse -> Bool
$c== :: UpdateLFTagResponse -> UpdateLFTagResponse -> Bool
Prelude.Eq, ReadPrec [UpdateLFTagResponse]
ReadPrec UpdateLFTagResponse
Int -> ReadS UpdateLFTagResponse
ReadS [UpdateLFTagResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateLFTagResponse]
$creadListPrec :: ReadPrec [UpdateLFTagResponse]
readPrec :: ReadPrec UpdateLFTagResponse
$creadPrec :: ReadPrec UpdateLFTagResponse
readList :: ReadS [UpdateLFTagResponse]
$creadList :: ReadS [UpdateLFTagResponse]
readsPrec :: Int -> ReadS UpdateLFTagResponse
$creadsPrec :: Int -> ReadS UpdateLFTagResponse
Prelude.Read, Int -> UpdateLFTagResponse -> ShowS
[UpdateLFTagResponse] -> ShowS
UpdateLFTagResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateLFTagResponse] -> ShowS
$cshowList :: [UpdateLFTagResponse] -> ShowS
show :: UpdateLFTagResponse -> String
$cshow :: UpdateLFTagResponse -> String
showsPrec :: Int -> UpdateLFTagResponse -> ShowS
$cshowsPrec :: Int -> UpdateLFTagResponse -> ShowS
Prelude.Show, forall x. Rep UpdateLFTagResponse x -> UpdateLFTagResponse
forall x. UpdateLFTagResponse -> Rep UpdateLFTagResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateLFTagResponse x -> UpdateLFTagResponse
$cfrom :: forall x. UpdateLFTagResponse -> Rep UpdateLFTagResponse x
Prelude.Generic)
newUpdateLFTagResponse ::
Prelude.Int ->
UpdateLFTagResponse
newUpdateLFTagResponse :: Int -> UpdateLFTagResponse
newUpdateLFTagResponse Int
pHttpStatus_ =
UpdateLFTagResponse' {$sel:httpStatus:UpdateLFTagResponse' :: Int
httpStatus = Int
pHttpStatus_}
updateLFTagResponse_httpStatus :: Lens.Lens' UpdateLFTagResponse Prelude.Int
updateLFTagResponse_httpStatus :: Lens' UpdateLFTagResponse Int
updateLFTagResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLFTagResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateLFTagResponse' :: UpdateLFTagResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateLFTagResponse
s@UpdateLFTagResponse' {} Int
a -> UpdateLFTagResponse
s {$sel:httpStatus:UpdateLFTagResponse' :: Int
httpStatus = Int
a} :: UpdateLFTagResponse)
instance Prelude.NFData UpdateLFTagResponse where
rnf :: UpdateLFTagResponse -> ()
rnf UpdateLFTagResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateLFTagResponse' :: UpdateLFTagResponse -> Int
..} = forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus