{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.LakeFormation.SearchTablesByLFTags
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- This operation allows a search on @TABLE@ resources by @LFTag@s. This
-- will be used by admins who want to grant user permissions on certain
-- LFTags. Before making a grant, the admin can use @SearchTablesByLFTags@
-- to find all resources where the given @LFTag@s are valid to verify
-- whether the returned resources can be shared.
module Amazonka.LakeFormation.SearchTablesByLFTags
  ( -- * Creating a Request
    SearchTablesByLFTags (..),
    newSearchTablesByLFTags,

    -- * Request Lenses
    searchTablesByLFTags_catalogId,
    searchTablesByLFTags_nextToken,
    searchTablesByLFTags_maxResults,
    searchTablesByLFTags_expression,

    -- * Destructuring the Response
    SearchTablesByLFTagsResponse (..),
    newSearchTablesByLFTagsResponse,

    -- * Response Lenses
    searchTablesByLFTagsResponse_tableList,
    searchTablesByLFTagsResponse_nextToken,
    searchTablesByLFTagsResponse_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

-- | /See:/ 'newSearchTablesByLFTags' smart constructor.
data SearchTablesByLFTags = SearchTablesByLFTags'
  { -- | The identifier for the Data Catalog. By default, the account ID. The
    -- Data Catalog is the persistent metadata store. It contains database
    -- definitions, table definitions, and other control information to manage
    -- your AWS Lake Formation environment.
    SearchTablesByLFTags -> Maybe Text
catalogId :: Prelude.Maybe Prelude.Text,
    -- | A continuation token, if this is not the first call to retrieve this
    -- list.
    SearchTablesByLFTags -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to return.
    SearchTablesByLFTags -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | A list of conditions (@LFTag@ structures) to search for in table
    -- resources.
    SearchTablesByLFTags -> NonEmpty LFTag
expression :: Prelude.NonEmpty LFTag
  }
  deriving (SearchTablesByLFTags -> SearchTablesByLFTags -> Bool
(SearchTablesByLFTags -> SearchTablesByLFTags -> Bool)
-> (SearchTablesByLFTags -> SearchTablesByLFTags -> Bool)
-> Eq SearchTablesByLFTags
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SearchTablesByLFTags -> SearchTablesByLFTags -> Bool
$c/= :: SearchTablesByLFTags -> SearchTablesByLFTags -> Bool
== :: SearchTablesByLFTags -> SearchTablesByLFTags -> Bool
$c== :: SearchTablesByLFTags -> SearchTablesByLFTags -> Bool
Prelude.Eq, ReadPrec [SearchTablesByLFTags]
ReadPrec SearchTablesByLFTags
Int -> ReadS SearchTablesByLFTags
ReadS [SearchTablesByLFTags]
(Int -> ReadS SearchTablesByLFTags)
-> ReadS [SearchTablesByLFTags]
-> ReadPrec SearchTablesByLFTags
-> ReadPrec [SearchTablesByLFTags]
-> Read SearchTablesByLFTags
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SearchTablesByLFTags]
$creadListPrec :: ReadPrec [SearchTablesByLFTags]
readPrec :: ReadPrec SearchTablesByLFTags
$creadPrec :: ReadPrec SearchTablesByLFTags
readList :: ReadS [SearchTablesByLFTags]
$creadList :: ReadS [SearchTablesByLFTags]
readsPrec :: Int -> ReadS SearchTablesByLFTags
$creadsPrec :: Int -> ReadS SearchTablesByLFTags
Prelude.Read, Int -> SearchTablesByLFTags -> ShowS
[SearchTablesByLFTags] -> ShowS
SearchTablesByLFTags -> String
(Int -> SearchTablesByLFTags -> ShowS)
-> (SearchTablesByLFTags -> String)
-> ([SearchTablesByLFTags] -> ShowS)
-> Show SearchTablesByLFTags
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SearchTablesByLFTags] -> ShowS
$cshowList :: [SearchTablesByLFTags] -> ShowS
show :: SearchTablesByLFTags -> String
$cshow :: SearchTablesByLFTags -> String
showsPrec :: Int -> SearchTablesByLFTags -> ShowS
$cshowsPrec :: Int -> SearchTablesByLFTags -> ShowS
Prelude.Show, (forall x. SearchTablesByLFTags -> Rep SearchTablesByLFTags x)
-> (forall x. Rep SearchTablesByLFTags x -> SearchTablesByLFTags)
-> Generic SearchTablesByLFTags
forall x. Rep SearchTablesByLFTags x -> SearchTablesByLFTags
forall x. SearchTablesByLFTags -> Rep SearchTablesByLFTags x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SearchTablesByLFTags x -> SearchTablesByLFTags
$cfrom :: forall x. SearchTablesByLFTags -> Rep SearchTablesByLFTags x
Prelude.Generic)

-- |
-- Create a value of 'SearchTablesByLFTags' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'catalogId', 'searchTablesByLFTags_catalogId' - The identifier for the Data Catalog. By default, the account ID. The
-- Data Catalog is the persistent metadata store. It contains database
-- definitions, table definitions, and other control information to manage
-- your AWS Lake Formation environment.
--
-- 'nextToken', 'searchTablesByLFTags_nextToken' - A continuation token, if this is not the first call to retrieve this
-- list.
--
-- 'maxResults', 'searchTablesByLFTags_maxResults' - The maximum number of results to return.
--
-- 'expression', 'searchTablesByLFTags_expression' - A list of conditions (@LFTag@ structures) to search for in table
-- resources.
newSearchTablesByLFTags ::
  -- | 'expression'
  Prelude.NonEmpty LFTag ->
  SearchTablesByLFTags
newSearchTablesByLFTags :: NonEmpty LFTag -> SearchTablesByLFTags
newSearchTablesByLFTags NonEmpty LFTag
pExpression_ =
  SearchTablesByLFTags' :: Maybe Text
-> Maybe Text
-> Maybe Natural
-> NonEmpty LFTag
-> SearchTablesByLFTags
SearchTablesByLFTags'
    { $sel:catalogId:SearchTablesByLFTags' :: Maybe Text
catalogId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:SearchTablesByLFTags' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:SearchTablesByLFTags' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:expression:SearchTablesByLFTags' :: NonEmpty LFTag
expression = Tagged (NonEmpty LFTag) (Identity (NonEmpty LFTag))
-> Tagged (NonEmpty LFTag) (Identity (NonEmpty LFTag))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged (NonEmpty LFTag) (Identity (NonEmpty LFTag))
 -> Tagged (NonEmpty LFTag) (Identity (NonEmpty LFTag)))
-> NonEmpty LFTag -> NonEmpty LFTag
forall t b. AReview t b -> b -> t
Lens.# NonEmpty LFTag
pExpression_
    }

-- | The identifier for the Data Catalog. By default, the account ID. The
-- Data Catalog is the persistent metadata store. It contains database
-- definitions, table definitions, and other control information to manage
-- your AWS Lake Formation environment.
searchTablesByLFTags_catalogId :: Lens.Lens' SearchTablesByLFTags (Prelude.Maybe Prelude.Text)
searchTablesByLFTags_catalogId :: (Maybe Text -> f (Maybe Text))
-> SearchTablesByLFTags -> f SearchTablesByLFTags
searchTablesByLFTags_catalogId = (SearchTablesByLFTags -> Maybe Text)
-> (SearchTablesByLFTags -> Maybe Text -> SearchTablesByLFTags)
-> Lens
     SearchTablesByLFTags SearchTablesByLFTags (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchTablesByLFTags' {Maybe Text
catalogId :: Maybe Text
$sel:catalogId:SearchTablesByLFTags' :: SearchTablesByLFTags -> Maybe Text
catalogId} -> Maybe Text
catalogId) (\s :: SearchTablesByLFTags
s@SearchTablesByLFTags' {} Maybe Text
a -> SearchTablesByLFTags
s {$sel:catalogId:SearchTablesByLFTags' :: Maybe Text
catalogId = Maybe Text
a} :: SearchTablesByLFTags)

-- | A continuation token, if this is not the first call to retrieve this
-- list.
searchTablesByLFTags_nextToken :: Lens.Lens' SearchTablesByLFTags (Prelude.Maybe Prelude.Text)
searchTablesByLFTags_nextToken :: (Maybe Text -> f (Maybe Text))
-> SearchTablesByLFTags -> f SearchTablesByLFTags
searchTablesByLFTags_nextToken = (SearchTablesByLFTags -> Maybe Text)
-> (SearchTablesByLFTags -> Maybe Text -> SearchTablesByLFTags)
-> Lens
     SearchTablesByLFTags SearchTablesByLFTags (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchTablesByLFTags' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:SearchTablesByLFTags' :: SearchTablesByLFTags -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: SearchTablesByLFTags
s@SearchTablesByLFTags' {} Maybe Text
a -> SearchTablesByLFTags
s {$sel:nextToken:SearchTablesByLFTags' :: Maybe Text
nextToken = Maybe Text
a} :: SearchTablesByLFTags)

-- | The maximum number of results to return.
searchTablesByLFTags_maxResults :: Lens.Lens' SearchTablesByLFTags (Prelude.Maybe Prelude.Natural)
searchTablesByLFTags_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> SearchTablesByLFTags -> f SearchTablesByLFTags
searchTablesByLFTags_maxResults = (SearchTablesByLFTags -> Maybe Natural)
-> (SearchTablesByLFTags -> Maybe Natural -> SearchTablesByLFTags)
-> Lens
     SearchTablesByLFTags
     SearchTablesByLFTags
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchTablesByLFTags' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:SearchTablesByLFTags' :: SearchTablesByLFTags -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: SearchTablesByLFTags
s@SearchTablesByLFTags' {} Maybe Natural
a -> SearchTablesByLFTags
s {$sel:maxResults:SearchTablesByLFTags' :: Maybe Natural
maxResults = Maybe Natural
a} :: SearchTablesByLFTags)

-- | A list of conditions (@LFTag@ structures) to search for in table
-- resources.
searchTablesByLFTags_expression :: Lens.Lens' SearchTablesByLFTags (Prelude.NonEmpty LFTag)
searchTablesByLFTags_expression :: (NonEmpty LFTag -> f (NonEmpty LFTag))
-> SearchTablesByLFTags -> f SearchTablesByLFTags
searchTablesByLFTags_expression = (SearchTablesByLFTags -> NonEmpty LFTag)
-> (SearchTablesByLFTags -> NonEmpty LFTag -> SearchTablesByLFTags)
-> Lens
     SearchTablesByLFTags
     SearchTablesByLFTags
     (NonEmpty LFTag)
     (NonEmpty LFTag)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchTablesByLFTags' {NonEmpty LFTag
expression :: NonEmpty LFTag
$sel:expression:SearchTablesByLFTags' :: SearchTablesByLFTags -> NonEmpty LFTag
expression} -> NonEmpty LFTag
expression) (\s :: SearchTablesByLFTags
s@SearchTablesByLFTags' {} NonEmpty LFTag
a -> SearchTablesByLFTags
s {$sel:expression:SearchTablesByLFTags' :: NonEmpty LFTag
expression = NonEmpty LFTag
a} :: SearchTablesByLFTags) ((NonEmpty LFTag -> f (NonEmpty LFTag))
 -> SearchTablesByLFTags -> f SearchTablesByLFTags)
-> ((NonEmpty LFTag -> f (NonEmpty LFTag))
    -> NonEmpty LFTag -> f (NonEmpty LFTag))
-> (NonEmpty LFTag -> f (NonEmpty LFTag))
-> SearchTablesByLFTags
-> f SearchTablesByLFTags
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty LFTag -> f (NonEmpty LFTag))
-> NonEmpty LFTag -> f (NonEmpty LFTag)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest SearchTablesByLFTags where
  type
    AWSResponse SearchTablesByLFTags =
      SearchTablesByLFTagsResponse
  request :: SearchTablesByLFTags -> Request SearchTablesByLFTags
request = Service -> SearchTablesByLFTags -> Request SearchTablesByLFTags
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy SearchTablesByLFTags
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse SearchTablesByLFTags)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse SearchTablesByLFTags))
-> Logger
-> Service
-> Proxy SearchTablesByLFTags
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse SearchTablesByLFTags)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe [TaggedTable]
-> Maybe Text -> Int -> SearchTablesByLFTagsResponse
SearchTablesByLFTagsResponse'
            (Maybe [TaggedTable]
 -> Maybe Text -> Int -> SearchTablesByLFTagsResponse)
-> Either String (Maybe [TaggedTable])
-> Either
     String (Maybe Text -> Int -> SearchTablesByLFTagsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [TaggedTable]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"TableList" Either String (Maybe (Maybe [TaggedTable]))
-> Maybe [TaggedTable] -> Either String (Maybe [TaggedTable])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [TaggedTable]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Maybe Text -> Int -> SearchTablesByLFTagsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> SearchTablesByLFTagsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextToken")
            Either String (Int -> SearchTablesByLFTagsResponse)
-> Either String Int -> Either String SearchTablesByLFTagsResponse
forall (f :: * -> *) a b. Applicative f => 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 SearchTablesByLFTags

instance Prelude.NFData SearchTablesByLFTags

instance Core.ToHeaders SearchTablesByLFTags where
  toHeaders :: SearchTablesByLFTags -> ResponseHeaders
toHeaders =
    ResponseHeaders -> SearchTablesByLFTags -> 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.SearchTablesByLFTags" ::
                          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 SearchTablesByLFTags where
  toJSON :: SearchTablesByLFTags -> Value
toJSON SearchTablesByLFTags' {Maybe Natural
Maybe Text
NonEmpty LFTag
expression :: NonEmpty LFTag
maxResults :: Maybe Natural
nextToken :: Maybe Text
catalogId :: Maybe Text
$sel:expression:SearchTablesByLFTags' :: SearchTablesByLFTags -> NonEmpty LFTag
$sel:maxResults:SearchTablesByLFTags' :: SearchTablesByLFTags -> Maybe Natural
$sel:nextToken:SearchTablesByLFTags' :: SearchTablesByLFTags -> Maybe Text
$sel:catalogId:SearchTablesByLFTags' :: SearchTablesByLFTags -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"CatalogId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
catalogId,
            (Text
"NextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Expression" Text -> NonEmpty LFTag -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty LFTag
expression)
          ]
      )

instance Core.ToPath SearchTablesByLFTags where
  toPath :: SearchTablesByLFTags -> ByteString
toPath = ByteString -> SearchTablesByLFTags -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery SearchTablesByLFTags where
  toQuery :: SearchTablesByLFTags -> QueryString
toQuery = QueryString -> SearchTablesByLFTags -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newSearchTablesByLFTagsResponse' smart constructor.
data SearchTablesByLFTagsResponse = SearchTablesByLFTagsResponse'
  { -- | A list of tables that meet the tag conditions.
    SearchTablesByLFTagsResponse -> Maybe [TaggedTable]
tableList :: Prelude.Maybe [TaggedTable],
    -- | A continuation token, present if the current list segment is not the
    -- last.
    SearchTablesByLFTagsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    SearchTablesByLFTagsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (SearchTablesByLFTagsResponse
-> SearchTablesByLFTagsResponse -> Bool
(SearchTablesByLFTagsResponse
 -> SearchTablesByLFTagsResponse -> Bool)
-> (SearchTablesByLFTagsResponse
    -> SearchTablesByLFTagsResponse -> Bool)
-> Eq SearchTablesByLFTagsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SearchTablesByLFTagsResponse
-> SearchTablesByLFTagsResponse -> Bool
$c/= :: SearchTablesByLFTagsResponse
-> SearchTablesByLFTagsResponse -> Bool
== :: SearchTablesByLFTagsResponse
-> SearchTablesByLFTagsResponse -> Bool
$c== :: SearchTablesByLFTagsResponse
-> SearchTablesByLFTagsResponse -> Bool
Prelude.Eq, ReadPrec [SearchTablesByLFTagsResponse]
ReadPrec SearchTablesByLFTagsResponse
Int -> ReadS SearchTablesByLFTagsResponse
ReadS [SearchTablesByLFTagsResponse]
(Int -> ReadS SearchTablesByLFTagsResponse)
-> ReadS [SearchTablesByLFTagsResponse]
-> ReadPrec SearchTablesByLFTagsResponse
-> ReadPrec [SearchTablesByLFTagsResponse]
-> Read SearchTablesByLFTagsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SearchTablesByLFTagsResponse]
$creadListPrec :: ReadPrec [SearchTablesByLFTagsResponse]
readPrec :: ReadPrec SearchTablesByLFTagsResponse
$creadPrec :: ReadPrec SearchTablesByLFTagsResponse
readList :: ReadS [SearchTablesByLFTagsResponse]
$creadList :: ReadS [SearchTablesByLFTagsResponse]
readsPrec :: Int -> ReadS SearchTablesByLFTagsResponse
$creadsPrec :: Int -> ReadS SearchTablesByLFTagsResponse
Prelude.Read, Int -> SearchTablesByLFTagsResponse -> ShowS
[SearchTablesByLFTagsResponse] -> ShowS
SearchTablesByLFTagsResponse -> String
(Int -> SearchTablesByLFTagsResponse -> ShowS)
-> (SearchTablesByLFTagsResponse -> String)
-> ([SearchTablesByLFTagsResponse] -> ShowS)
-> Show SearchTablesByLFTagsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SearchTablesByLFTagsResponse] -> ShowS
$cshowList :: [SearchTablesByLFTagsResponse] -> ShowS
show :: SearchTablesByLFTagsResponse -> String
$cshow :: SearchTablesByLFTagsResponse -> String
showsPrec :: Int -> SearchTablesByLFTagsResponse -> ShowS
$cshowsPrec :: Int -> SearchTablesByLFTagsResponse -> ShowS
Prelude.Show, (forall x.
 SearchTablesByLFTagsResponse -> Rep SearchTablesByLFTagsResponse x)
-> (forall x.
    Rep SearchTablesByLFTagsResponse x -> SearchTablesByLFTagsResponse)
-> Generic SearchTablesByLFTagsResponse
forall x.
Rep SearchTablesByLFTagsResponse x -> SearchTablesByLFTagsResponse
forall x.
SearchTablesByLFTagsResponse -> Rep SearchTablesByLFTagsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SearchTablesByLFTagsResponse x -> SearchTablesByLFTagsResponse
$cfrom :: forall x.
SearchTablesByLFTagsResponse -> Rep SearchTablesByLFTagsResponse x
Prelude.Generic)

-- |
-- Create a value of 'SearchTablesByLFTagsResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'tableList', 'searchTablesByLFTagsResponse_tableList' - A list of tables that meet the tag conditions.
--
-- 'nextToken', 'searchTablesByLFTagsResponse_nextToken' - A continuation token, present if the current list segment is not the
-- last.
--
-- 'httpStatus', 'searchTablesByLFTagsResponse_httpStatus' - The response's http status code.
newSearchTablesByLFTagsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  SearchTablesByLFTagsResponse
newSearchTablesByLFTagsResponse :: Int -> SearchTablesByLFTagsResponse
newSearchTablesByLFTagsResponse Int
pHttpStatus_ =
  SearchTablesByLFTagsResponse' :: Maybe [TaggedTable]
-> Maybe Text -> Int -> SearchTablesByLFTagsResponse
SearchTablesByLFTagsResponse'
    { $sel:tableList:SearchTablesByLFTagsResponse' :: Maybe [TaggedTable]
tableList =
        Maybe [TaggedTable]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:SearchTablesByLFTagsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:SearchTablesByLFTagsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of tables that meet the tag conditions.
searchTablesByLFTagsResponse_tableList :: Lens.Lens' SearchTablesByLFTagsResponse (Prelude.Maybe [TaggedTable])
searchTablesByLFTagsResponse_tableList :: (Maybe [TaggedTable] -> f (Maybe [TaggedTable]))
-> SearchTablesByLFTagsResponse -> f SearchTablesByLFTagsResponse
searchTablesByLFTagsResponse_tableList = (SearchTablesByLFTagsResponse -> Maybe [TaggedTable])
-> (SearchTablesByLFTagsResponse
    -> Maybe [TaggedTable] -> SearchTablesByLFTagsResponse)
-> Lens
     SearchTablesByLFTagsResponse
     SearchTablesByLFTagsResponse
     (Maybe [TaggedTable])
     (Maybe [TaggedTable])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchTablesByLFTagsResponse' {Maybe [TaggedTable]
tableList :: Maybe [TaggedTable]
$sel:tableList:SearchTablesByLFTagsResponse' :: SearchTablesByLFTagsResponse -> Maybe [TaggedTable]
tableList} -> Maybe [TaggedTable]
tableList) (\s :: SearchTablesByLFTagsResponse
s@SearchTablesByLFTagsResponse' {} Maybe [TaggedTable]
a -> SearchTablesByLFTagsResponse
s {$sel:tableList:SearchTablesByLFTagsResponse' :: Maybe [TaggedTable]
tableList = Maybe [TaggedTable]
a} :: SearchTablesByLFTagsResponse) ((Maybe [TaggedTable] -> f (Maybe [TaggedTable]))
 -> SearchTablesByLFTagsResponse -> f SearchTablesByLFTagsResponse)
-> ((Maybe [TaggedTable] -> f (Maybe [TaggedTable]))
    -> Maybe [TaggedTable] -> f (Maybe [TaggedTable]))
-> (Maybe [TaggedTable] -> f (Maybe [TaggedTable]))
-> SearchTablesByLFTagsResponse
-> f SearchTablesByLFTagsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [TaggedTable] [TaggedTable] [TaggedTable] [TaggedTable]
-> Iso
     (Maybe [TaggedTable])
     (Maybe [TaggedTable])
     (Maybe [TaggedTable])
     (Maybe [TaggedTable])
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 AnIso [TaggedTable] [TaggedTable] [TaggedTable] [TaggedTable]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A continuation token, present if the current list segment is not the
-- last.
searchTablesByLFTagsResponse_nextToken :: Lens.Lens' SearchTablesByLFTagsResponse (Prelude.Maybe Prelude.Text)
searchTablesByLFTagsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> SearchTablesByLFTagsResponse -> f SearchTablesByLFTagsResponse
searchTablesByLFTagsResponse_nextToken = (SearchTablesByLFTagsResponse -> Maybe Text)
-> (SearchTablesByLFTagsResponse
    -> Maybe Text -> SearchTablesByLFTagsResponse)
-> Lens
     SearchTablesByLFTagsResponse
     SearchTablesByLFTagsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchTablesByLFTagsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:SearchTablesByLFTagsResponse' :: SearchTablesByLFTagsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: SearchTablesByLFTagsResponse
s@SearchTablesByLFTagsResponse' {} Maybe Text
a -> SearchTablesByLFTagsResponse
s {$sel:nextToken:SearchTablesByLFTagsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: SearchTablesByLFTagsResponse)

-- | The response's http status code.
searchTablesByLFTagsResponse_httpStatus :: Lens.Lens' SearchTablesByLFTagsResponse Prelude.Int
searchTablesByLFTagsResponse_httpStatus :: (Int -> f Int)
-> SearchTablesByLFTagsResponse -> f SearchTablesByLFTagsResponse
searchTablesByLFTagsResponse_httpStatus = (SearchTablesByLFTagsResponse -> Int)
-> (SearchTablesByLFTagsResponse
    -> Int -> SearchTablesByLFTagsResponse)
-> Lens
     SearchTablesByLFTagsResponse SearchTablesByLFTagsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchTablesByLFTagsResponse' {Int
httpStatus :: Int
$sel:httpStatus:SearchTablesByLFTagsResponse' :: SearchTablesByLFTagsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: SearchTablesByLFTagsResponse
s@SearchTablesByLFTagsResponse' {} Int
a -> SearchTablesByLFTagsResponse
s {$sel:httpStatus:SearchTablesByLFTagsResponse' :: Int
httpStatus = Int
a} :: SearchTablesByLFTagsResponse)

instance Prelude.NFData SearchTablesByLFTagsResponse