{-# 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.ListLFTags
(
ListLFTags (..),
newListLFTags,
listLFTags_catalogId,
listLFTags_maxResults,
listLFTags_nextToken,
listLFTags_resourceShareType,
ListLFTagsResponse (..),
newListLFTagsResponse,
listLFTagsResponse_lFTags,
listLFTagsResponse_nextToken,
listLFTagsResponse_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 ListLFTags = ListLFTags'
{
ListLFTags -> Maybe Text
catalogId :: Prelude.Maybe Prelude.Text,
ListLFTags -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListLFTags -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListLFTags -> Maybe ResourceShareType
resourceShareType :: Prelude.Maybe ResourceShareType
}
deriving (ListLFTags -> ListLFTags -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListLFTags -> ListLFTags -> Bool
$c/= :: ListLFTags -> ListLFTags -> Bool
== :: ListLFTags -> ListLFTags -> Bool
$c== :: ListLFTags -> ListLFTags -> Bool
Prelude.Eq, ReadPrec [ListLFTags]
ReadPrec ListLFTags
Int -> ReadS ListLFTags
ReadS [ListLFTags]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListLFTags]
$creadListPrec :: ReadPrec [ListLFTags]
readPrec :: ReadPrec ListLFTags
$creadPrec :: ReadPrec ListLFTags
readList :: ReadS [ListLFTags]
$creadList :: ReadS [ListLFTags]
readsPrec :: Int -> ReadS ListLFTags
$creadsPrec :: Int -> ReadS ListLFTags
Prelude.Read, Int -> ListLFTags -> ShowS
[ListLFTags] -> ShowS
ListLFTags -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListLFTags] -> ShowS
$cshowList :: [ListLFTags] -> ShowS
show :: ListLFTags -> String
$cshow :: ListLFTags -> String
showsPrec :: Int -> ListLFTags -> ShowS
$cshowsPrec :: Int -> ListLFTags -> ShowS
Prelude.Show, forall x. Rep ListLFTags x -> ListLFTags
forall x. ListLFTags -> Rep ListLFTags x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListLFTags x -> ListLFTags
$cfrom :: forall x. ListLFTags -> Rep ListLFTags x
Prelude.Generic)
newListLFTags ::
ListLFTags
newListLFTags :: ListLFTags
newListLFTags =
ListLFTags'
{ $sel:catalogId:ListLFTags' :: Maybe Text
catalogId = forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:ListLFTags' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListLFTags' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:resourceShareType:ListLFTags' :: Maybe ResourceShareType
resourceShareType = forall a. Maybe a
Prelude.Nothing
}
listLFTags_catalogId :: Lens.Lens' ListLFTags (Prelude.Maybe Prelude.Text)
listLFTags_catalogId :: Lens' ListLFTags (Maybe Text)
listLFTags_catalogId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLFTags' {Maybe Text
catalogId :: Maybe Text
$sel:catalogId:ListLFTags' :: ListLFTags -> Maybe Text
catalogId} -> Maybe Text
catalogId) (\s :: ListLFTags
s@ListLFTags' {} Maybe Text
a -> ListLFTags
s {$sel:catalogId:ListLFTags' :: Maybe Text
catalogId = Maybe Text
a} :: ListLFTags)
listLFTags_maxResults :: Lens.Lens' ListLFTags (Prelude.Maybe Prelude.Natural)
listLFTags_maxResults :: Lens' ListLFTags (Maybe Natural)
listLFTags_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLFTags' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListLFTags' :: ListLFTags -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListLFTags
s@ListLFTags' {} Maybe Natural
a -> ListLFTags
s {$sel:maxResults:ListLFTags' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListLFTags)
listLFTags_nextToken :: Lens.Lens' ListLFTags (Prelude.Maybe Prelude.Text)
listLFTags_nextToken :: Lens' ListLFTags (Maybe Text)
listLFTags_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLFTags' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListLFTags' :: ListLFTags -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListLFTags
s@ListLFTags' {} Maybe Text
a -> ListLFTags
s {$sel:nextToken:ListLFTags' :: Maybe Text
nextToken = Maybe Text
a} :: ListLFTags)
listLFTags_resourceShareType :: Lens.Lens' ListLFTags (Prelude.Maybe ResourceShareType)
listLFTags_resourceShareType :: Lens' ListLFTags (Maybe ResourceShareType)
listLFTags_resourceShareType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLFTags' {Maybe ResourceShareType
resourceShareType :: Maybe ResourceShareType
$sel:resourceShareType:ListLFTags' :: ListLFTags -> Maybe ResourceShareType
resourceShareType} -> Maybe ResourceShareType
resourceShareType) (\s :: ListLFTags
s@ListLFTags' {} Maybe ResourceShareType
a -> ListLFTags
s {$sel:resourceShareType:ListLFTags' :: Maybe ResourceShareType
resourceShareType = Maybe ResourceShareType
a} :: ListLFTags)
instance Core.AWSPager ListLFTags where
page :: ListLFTags -> AWSResponse ListLFTags -> Maybe ListLFTags
page ListLFTags
rq AWSResponse ListLFTags
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListLFTags
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListLFTagsResponse (Maybe Text)
listLFTagsResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListLFTags
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListLFTagsResponse (Maybe (NonEmpty LFTagPair))
listLFTagsResponse_lFTags
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to forall l. IsList l => l -> [Item l]
Prelude.toList
) =
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
forall a. a -> Maybe a
Prelude.Just
forall a b. (a -> b) -> a -> b
Prelude.$ ListLFTags
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListLFTags (Maybe Text)
listLFTags_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListLFTags
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListLFTagsResponse (Maybe Text)
listLFTagsResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
instance Core.AWSRequest ListLFTags where
type AWSResponse ListLFTags = ListLFTagsResponse
request :: (Service -> Service) -> ListLFTags -> Request ListLFTags
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 ListLFTags
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListLFTags)))
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 (NonEmpty LFTagPair)
-> Maybe Text -> Int -> ListLFTagsResponse
ListLFTagsResponse'
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
"LFTags")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
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 ListLFTags where
hashWithSalt :: Int -> ListLFTags -> Int
hashWithSalt Int
_salt ListLFTags' {Maybe Natural
Maybe Text
Maybe ResourceShareType
resourceShareType :: Maybe ResourceShareType
nextToken :: Maybe Text
maxResults :: Maybe Natural
catalogId :: Maybe Text
$sel:resourceShareType:ListLFTags' :: ListLFTags -> Maybe ResourceShareType
$sel:nextToken:ListLFTags' :: ListLFTags -> Maybe Text
$sel:maxResults:ListLFTags' :: ListLFTags -> Maybe Natural
$sel:catalogId:ListLFTags' :: ListLFTags -> 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 Natural
maxResults
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ResourceShareType
resourceShareType
instance Prelude.NFData ListLFTags where
rnf :: ListLFTags -> ()
rnf ListLFTags' {Maybe Natural
Maybe Text
Maybe ResourceShareType
resourceShareType :: Maybe ResourceShareType
nextToken :: Maybe Text
maxResults :: Maybe Natural
catalogId :: Maybe Text
$sel:resourceShareType:ListLFTags' :: ListLFTags -> Maybe ResourceShareType
$sel:nextToken:ListLFTags' :: ListLFTags -> Maybe Text
$sel:maxResults:ListLFTags' :: ListLFTags -> Maybe Natural
$sel:catalogId:ListLFTags' :: ListLFTags -> 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 Natural
maxResults
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ResourceShareType
resourceShareType
instance Data.ToHeaders ListLFTags where
toHeaders :: ListLFTags -> 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 ListLFTags where
toJSON :: ListLFTags -> Value
toJSON ListLFTags' {Maybe Natural
Maybe Text
Maybe ResourceShareType
resourceShareType :: Maybe ResourceShareType
nextToken :: Maybe Text
maxResults :: Maybe Natural
catalogId :: Maybe Text
$sel:resourceShareType:ListLFTags' :: ListLFTags -> Maybe ResourceShareType
$sel:nextToken:ListLFTags' :: ListLFTags -> Maybe Text
$sel:maxResults:ListLFTags' :: ListLFTags -> Maybe Natural
$sel:catalogId:ListLFTags' :: ListLFTags -> 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
"MaxResults" 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 Natural
maxResults,
(Key
"NextToken" 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
nextToken,
(Key
"ResourceShareType" 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 ResourceShareType
resourceShareType
]
)
instance Data.ToPath ListLFTags where
toPath :: ListLFTags -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/ListLFTags"
instance Data.ToQuery ListLFTags where
toQuery :: ListLFTags -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListLFTagsResponse = ListLFTagsResponse'
{
ListLFTagsResponse -> Maybe (NonEmpty LFTagPair)
lFTags :: Prelude.Maybe (Prelude.NonEmpty LFTagPair),
ListLFTagsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListLFTagsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListLFTagsResponse -> ListLFTagsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListLFTagsResponse -> ListLFTagsResponse -> Bool
$c/= :: ListLFTagsResponse -> ListLFTagsResponse -> Bool
== :: ListLFTagsResponse -> ListLFTagsResponse -> Bool
$c== :: ListLFTagsResponse -> ListLFTagsResponse -> Bool
Prelude.Eq, ReadPrec [ListLFTagsResponse]
ReadPrec ListLFTagsResponse
Int -> ReadS ListLFTagsResponse
ReadS [ListLFTagsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListLFTagsResponse]
$creadListPrec :: ReadPrec [ListLFTagsResponse]
readPrec :: ReadPrec ListLFTagsResponse
$creadPrec :: ReadPrec ListLFTagsResponse
readList :: ReadS [ListLFTagsResponse]
$creadList :: ReadS [ListLFTagsResponse]
readsPrec :: Int -> ReadS ListLFTagsResponse
$creadsPrec :: Int -> ReadS ListLFTagsResponse
Prelude.Read, Int -> ListLFTagsResponse -> ShowS
[ListLFTagsResponse] -> ShowS
ListLFTagsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListLFTagsResponse] -> ShowS
$cshowList :: [ListLFTagsResponse] -> ShowS
show :: ListLFTagsResponse -> String
$cshow :: ListLFTagsResponse -> String
showsPrec :: Int -> ListLFTagsResponse -> ShowS
$cshowsPrec :: Int -> ListLFTagsResponse -> ShowS
Prelude.Show, forall x. Rep ListLFTagsResponse x -> ListLFTagsResponse
forall x. ListLFTagsResponse -> Rep ListLFTagsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListLFTagsResponse x -> ListLFTagsResponse
$cfrom :: forall x. ListLFTagsResponse -> Rep ListLFTagsResponse x
Prelude.Generic)
newListLFTagsResponse ::
Prelude.Int ->
ListLFTagsResponse
newListLFTagsResponse :: Int -> ListLFTagsResponse
newListLFTagsResponse Int
pHttpStatus_ =
ListLFTagsResponse'
{ $sel:lFTags:ListLFTagsResponse' :: Maybe (NonEmpty LFTagPair)
lFTags = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListLFTagsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListLFTagsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listLFTagsResponse_lFTags :: Lens.Lens' ListLFTagsResponse (Prelude.Maybe (Prelude.NonEmpty LFTagPair))
listLFTagsResponse_lFTags :: Lens' ListLFTagsResponse (Maybe (NonEmpty LFTagPair))
listLFTagsResponse_lFTags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLFTagsResponse' {Maybe (NonEmpty LFTagPair)
lFTags :: Maybe (NonEmpty LFTagPair)
$sel:lFTags:ListLFTagsResponse' :: ListLFTagsResponse -> Maybe (NonEmpty LFTagPair)
lFTags} -> Maybe (NonEmpty LFTagPair)
lFTags) (\s :: ListLFTagsResponse
s@ListLFTagsResponse' {} Maybe (NonEmpty LFTagPair)
a -> ListLFTagsResponse
s {$sel:lFTags:ListLFTagsResponse' :: Maybe (NonEmpty LFTagPair)
lFTags = Maybe (NonEmpty LFTagPair)
a} :: ListLFTagsResponse) 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
listLFTagsResponse_nextToken :: Lens.Lens' ListLFTagsResponse (Prelude.Maybe Prelude.Text)
listLFTagsResponse_nextToken :: Lens' ListLFTagsResponse (Maybe Text)
listLFTagsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLFTagsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListLFTagsResponse' :: ListLFTagsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListLFTagsResponse
s@ListLFTagsResponse' {} Maybe Text
a -> ListLFTagsResponse
s {$sel:nextToken:ListLFTagsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListLFTagsResponse)
listLFTagsResponse_httpStatus :: Lens.Lens' ListLFTagsResponse Prelude.Int
listLFTagsResponse_httpStatus :: Lens' ListLFTagsResponse Int
listLFTagsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLFTagsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListLFTagsResponse' :: ListLFTagsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListLFTagsResponse
s@ListLFTagsResponse' {} Int
a -> ListLFTagsResponse
s {$sel:httpStatus:ListLFTagsResponse' :: Int
httpStatus = Int
a} :: ListLFTagsResponse)
instance Prelude.NFData ListLFTagsResponse where
rnf :: ListLFTagsResponse -> ()
rnf ListLFTagsResponse' {Int
Maybe (NonEmpty LFTagPair)
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
lFTags :: Maybe (NonEmpty LFTagPair)
$sel:httpStatus:ListLFTagsResponse' :: ListLFTagsResponse -> Int
$sel:nextToken:ListLFTagsResponse' :: ListLFTagsResponse -> Maybe Text
$sel:lFTags:ListLFTagsResponse' :: ListLFTagsResponse -> Maybe (NonEmpty LFTagPair)
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty LFTagPair)
lFTags
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus