{-# 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.DynamoDB.ListTables
-- 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)
--
-- Returns an array of table names associated with the current account and
-- endpoint. The output from @ListTables@ is paginated, with each page
-- returning a maximum of 100 table names.
--
-- This operation returns paginated results.
module Amazonka.DynamoDB.ListTables
  ( -- * Creating a Request
    ListTables (..),
    newListTables,

    -- * Request Lenses
    listTables_exclusiveStartTableName,
    listTables_limit,

    -- * Destructuring the Response
    ListTablesResponse (..),
    newListTablesResponse,

    -- * Response Lenses
    listTablesResponse_lastEvaluatedTableName,
    listTablesResponse_tableNames,
    listTablesResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.DynamoDB.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

-- | Represents the input of a @ListTables@ operation.
--
-- /See:/ 'newListTables' smart constructor.
data ListTables = ListTables'
  { -- | The first table name that this operation will evaluate. Use the value
    -- that was returned for @LastEvaluatedTableName@ in a previous operation,
    -- so that you can obtain the next page of results.
    ListTables -> Maybe Text
exclusiveStartTableName :: Prelude.Maybe Prelude.Text,
    -- | A maximum number of table names to return. If this parameter is not
    -- specified, the limit is 100.
    ListTables -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListTables -> ListTables -> Bool
(ListTables -> ListTables -> Bool)
-> (ListTables -> ListTables -> Bool) -> Eq ListTables
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTables -> ListTables -> Bool
$c/= :: ListTables -> ListTables -> Bool
== :: ListTables -> ListTables -> Bool
$c== :: ListTables -> ListTables -> Bool
Prelude.Eq, ReadPrec [ListTables]
ReadPrec ListTables
Int -> ReadS ListTables
ReadS [ListTables]
(Int -> ReadS ListTables)
-> ReadS [ListTables]
-> ReadPrec ListTables
-> ReadPrec [ListTables]
-> Read ListTables
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTables]
$creadListPrec :: ReadPrec [ListTables]
readPrec :: ReadPrec ListTables
$creadPrec :: ReadPrec ListTables
readList :: ReadS [ListTables]
$creadList :: ReadS [ListTables]
readsPrec :: Int -> ReadS ListTables
$creadsPrec :: Int -> ReadS ListTables
Prelude.Read, Int -> ListTables -> ShowS
[ListTables] -> ShowS
ListTables -> String
(Int -> ListTables -> ShowS)
-> (ListTables -> String)
-> ([ListTables] -> ShowS)
-> Show ListTables
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTables] -> ShowS
$cshowList :: [ListTables] -> ShowS
show :: ListTables -> String
$cshow :: ListTables -> String
showsPrec :: Int -> ListTables -> ShowS
$cshowsPrec :: Int -> ListTables -> ShowS
Prelude.Show, (forall x. ListTables -> Rep ListTables x)
-> (forall x. Rep ListTables x -> ListTables) -> Generic ListTables
forall x. Rep ListTables x -> ListTables
forall x. ListTables -> Rep ListTables x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListTables x -> ListTables
$cfrom :: forall x. ListTables -> Rep ListTables x
Prelude.Generic)

-- |
-- Create a value of 'ListTables' 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:
--
-- 'exclusiveStartTableName', 'listTables_exclusiveStartTableName' - The first table name that this operation will evaluate. Use the value
-- that was returned for @LastEvaluatedTableName@ in a previous operation,
-- so that you can obtain the next page of results.
--
-- 'limit', 'listTables_limit' - A maximum number of table names to return. If this parameter is not
-- specified, the limit is 100.
newListTables ::
  ListTables
newListTables :: ListTables
newListTables =
  ListTables' :: Maybe Text -> Maybe Natural -> ListTables
ListTables'
    { $sel:exclusiveStartTableName:ListTables' :: Maybe Text
exclusiveStartTableName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:limit:ListTables' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The first table name that this operation will evaluate. Use the value
-- that was returned for @LastEvaluatedTableName@ in a previous operation,
-- so that you can obtain the next page of results.
listTables_exclusiveStartTableName :: Lens.Lens' ListTables (Prelude.Maybe Prelude.Text)
listTables_exclusiveStartTableName :: (Maybe Text -> f (Maybe Text)) -> ListTables -> f ListTables
listTables_exclusiveStartTableName = (ListTables -> Maybe Text)
-> (ListTables -> Maybe Text -> ListTables)
-> Lens ListTables ListTables (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTables' {Maybe Text
exclusiveStartTableName :: Maybe Text
$sel:exclusiveStartTableName:ListTables' :: ListTables -> Maybe Text
exclusiveStartTableName} -> Maybe Text
exclusiveStartTableName) (\s :: ListTables
s@ListTables' {} Maybe Text
a -> ListTables
s {$sel:exclusiveStartTableName:ListTables' :: Maybe Text
exclusiveStartTableName = Maybe Text
a} :: ListTables)

-- | A maximum number of table names to return. If this parameter is not
-- specified, the limit is 100.
listTables_limit :: Lens.Lens' ListTables (Prelude.Maybe Prelude.Natural)
listTables_limit :: (Maybe Natural -> f (Maybe Natural)) -> ListTables -> f ListTables
listTables_limit = (ListTables -> Maybe Natural)
-> (ListTables -> Maybe Natural -> ListTables)
-> Lens ListTables ListTables (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTables' {Maybe Natural
limit :: Maybe Natural
$sel:limit:ListTables' :: ListTables -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: ListTables
s@ListTables' {} Maybe Natural
a -> ListTables
s {$sel:limit:ListTables' :: Maybe Natural
limit = Maybe Natural
a} :: ListTables)

instance Core.AWSPager ListTables where
  page :: ListTables -> AWSResponse ListTables -> Maybe ListTables
page ListTables
rq AWSResponse ListTables
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListTables
ListTablesResponse
rs
            ListTablesResponse
-> Getting (First Text) ListTablesResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListTablesResponse -> Const (First Text) ListTablesResponse
Lens' ListTablesResponse (Maybe Text)
listTablesResponse_lastEvaluatedTableName
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListTablesResponse -> Const (First Text) ListTablesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListTablesResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListTables
forall a. Maybe a
Prelude.Nothing
    | Maybe [Text] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListTables
ListTablesResponse
rs
            ListTablesResponse
-> Getting (First [Text]) ListTablesResponse [Text] -> Maybe [Text]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
-> ListTablesResponse -> Const (First [Text]) ListTablesResponse
Lens' ListTablesResponse (Maybe [Text])
listTablesResponse_tableNames ((Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
 -> ListTablesResponse -> Const (First [Text]) ListTablesResponse)
-> (([Text] -> Const (First [Text]) [Text])
    -> Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
-> Getting (First [Text]) ListTablesResponse [Text]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> Const (First [Text]) [Text])
-> Maybe [Text] -> Const (First [Text]) (Maybe [Text])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListTables
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListTables -> Maybe ListTables
forall a. a -> Maybe a
Prelude.Just (ListTables -> Maybe ListTables) -> ListTables -> Maybe ListTables
forall a b. (a -> b) -> a -> b
Prelude.$
        ListTables
rq
          ListTables -> (ListTables -> ListTables) -> ListTables
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListTables -> Identity ListTables
Lens ListTables ListTables (Maybe Text) (Maybe Text)
listTables_exclusiveStartTableName
          ((Maybe Text -> Identity (Maybe Text))
 -> ListTables -> Identity ListTables)
-> Maybe Text -> ListTables -> ListTables
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListTables
ListTablesResponse
rs
          ListTablesResponse
-> Getting (First Text) ListTablesResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListTablesResponse -> Const (First Text) ListTablesResponse
Lens' ListTablesResponse (Maybe Text)
listTablesResponse_lastEvaluatedTableName
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListTablesResponse -> Const (First Text) ListTablesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListTablesResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListTables where
  type AWSResponse ListTables = ListTablesResponse
  request :: ListTables -> Request ListTables
request = Service -> ListTables -> Request ListTables
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListTables
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListTables)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListTables))
-> Logger
-> Service
-> Proxy ListTables
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListTables)))
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 Text -> Maybe [Text] -> Int -> ListTablesResponse
ListTablesResponse'
            (Maybe Text -> Maybe [Text] -> Int -> ListTablesResponse)
-> Either String (Maybe Text)
-> Either String (Maybe [Text] -> Int -> ListTablesResponse)
forall (f :: * -> *) a b. Functor 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
"LastEvaluatedTableName")
            Either String (Maybe [Text] -> Int -> ListTablesResponse)
-> Either String (Maybe [Text])
-> Either String (Int -> ListTablesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"TableNames" Either String (Maybe (Maybe [Text]))
-> Maybe [Text] -> Either String (Maybe [Text])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> ListTablesResponse)
-> Either String Int -> Either String ListTablesResponse
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 ListTables

instance Prelude.NFData ListTables

instance Core.ToHeaders ListTables where
  toHeaders :: ListTables -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListTables -> 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
"DynamoDB_20120810.ListTables" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.0" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON ListTables where
  toJSON :: ListTables -> Value
toJSON ListTables' {Maybe Natural
Maybe Text
limit :: Maybe Natural
exclusiveStartTableName :: Maybe Text
$sel:limit:ListTables' :: ListTables -> Maybe Natural
$sel:exclusiveStartTableName:ListTables' :: ListTables -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ExclusiveStartTableName" 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
exclusiveStartTableName,
            (Text
"Limit" 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
limit
          ]
      )

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

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

-- | Represents the output of a @ListTables@ operation.
--
-- /See:/ 'newListTablesResponse' smart constructor.
data ListTablesResponse = ListTablesResponse'
  { -- | The name of the last table in the current page of results. Use this
    -- value as the @ExclusiveStartTableName@ in a new request to obtain the
    -- next page of results, until all the table names are returned.
    --
    -- If you do not receive a @LastEvaluatedTableName@ value in the response,
    -- this means that there are no more table names to be retrieved.
    ListTablesResponse -> Maybe Text
lastEvaluatedTableName :: Prelude.Maybe Prelude.Text,
    -- | The names of the tables associated with the current account at the
    -- current endpoint. The maximum size of this array is 100.
    --
    -- If @LastEvaluatedTableName@ also appears in the output, you can use this
    -- value as the @ExclusiveStartTableName@ parameter in a subsequent
    -- @ListTables@ request and obtain the next page of results.
    ListTablesResponse -> Maybe [Text]
tableNames :: Prelude.Maybe [Prelude.Text],
    -- | The response's http status code.
    ListTablesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListTablesResponse -> ListTablesResponse -> Bool
(ListTablesResponse -> ListTablesResponse -> Bool)
-> (ListTablesResponse -> ListTablesResponse -> Bool)
-> Eq ListTablesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTablesResponse -> ListTablesResponse -> Bool
$c/= :: ListTablesResponse -> ListTablesResponse -> Bool
== :: ListTablesResponse -> ListTablesResponse -> Bool
$c== :: ListTablesResponse -> ListTablesResponse -> Bool
Prelude.Eq, ReadPrec [ListTablesResponse]
ReadPrec ListTablesResponse
Int -> ReadS ListTablesResponse
ReadS [ListTablesResponse]
(Int -> ReadS ListTablesResponse)
-> ReadS [ListTablesResponse]
-> ReadPrec ListTablesResponse
-> ReadPrec [ListTablesResponse]
-> Read ListTablesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTablesResponse]
$creadListPrec :: ReadPrec [ListTablesResponse]
readPrec :: ReadPrec ListTablesResponse
$creadPrec :: ReadPrec ListTablesResponse
readList :: ReadS [ListTablesResponse]
$creadList :: ReadS [ListTablesResponse]
readsPrec :: Int -> ReadS ListTablesResponse
$creadsPrec :: Int -> ReadS ListTablesResponse
Prelude.Read, Int -> ListTablesResponse -> ShowS
[ListTablesResponse] -> ShowS
ListTablesResponse -> String
(Int -> ListTablesResponse -> ShowS)
-> (ListTablesResponse -> String)
-> ([ListTablesResponse] -> ShowS)
-> Show ListTablesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTablesResponse] -> ShowS
$cshowList :: [ListTablesResponse] -> ShowS
show :: ListTablesResponse -> String
$cshow :: ListTablesResponse -> String
showsPrec :: Int -> ListTablesResponse -> ShowS
$cshowsPrec :: Int -> ListTablesResponse -> ShowS
Prelude.Show, (forall x. ListTablesResponse -> Rep ListTablesResponse x)
-> (forall x. Rep ListTablesResponse x -> ListTablesResponse)
-> Generic ListTablesResponse
forall x. Rep ListTablesResponse x -> ListTablesResponse
forall x. ListTablesResponse -> Rep ListTablesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListTablesResponse x -> ListTablesResponse
$cfrom :: forall x. ListTablesResponse -> Rep ListTablesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListTablesResponse' 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:
--
-- 'lastEvaluatedTableName', 'listTablesResponse_lastEvaluatedTableName' - The name of the last table in the current page of results. Use this
-- value as the @ExclusiveStartTableName@ in a new request to obtain the
-- next page of results, until all the table names are returned.
--
-- If you do not receive a @LastEvaluatedTableName@ value in the response,
-- this means that there are no more table names to be retrieved.
--
-- 'tableNames', 'listTablesResponse_tableNames' - The names of the tables associated with the current account at the
-- current endpoint. The maximum size of this array is 100.
--
-- If @LastEvaluatedTableName@ also appears in the output, you can use this
-- value as the @ExclusiveStartTableName@ parameter in a subsequent
-- @ListTables@ request and obtain the next page of results.
--
-- 'httpStatus', 'listTablesResponse_httpStatus' - The response's http status code.
newListTablesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListTablesResponse
newListTablesResponse :: Int -> ListTablesResponse
newListTablesResponse Int
pHttpStatus_ =
  ListTablesResponse' :: Maybe Text -> Maybe [Text] -> Int -> ListTablesResponse
ListTablesResponse'
    { $sel:lastEvaluatedTableName:ListTablesResponse' :: Maybe Text
lastEvaluatedTableName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tableNames:ListTablesResponse' :: Maybe [Text]
tableNames = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListTablesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The name of the last table in the current page of results. Use this
-- value as the @ExclusiveStartTableName@ in a new request to obtain the
-- next page of results, until all the table names are returned.
--
-- If you do not receive a @LastEvaluatedTableName@ value in the response,
-- this means that there are no more table names to be retrieved.
listTablesResponse_lastEvaluatedTableName :: Lens.Lens' ListTablesResponse (Prelude.Maybe Prelude.Text)
listTablesResponse_lastEvaluatedTableName :: (Maybe Text -> f (Maybe Text))
-> ListTablesResponse -> f ListTablesResponse
listTablesResponse_lastEvaluatedTableName = (ListTablesResponse -> Maybe Text)
-> (ListTablesResponse -> Maybe Text -> ListTablesResponse)
-> Lens' ListTablesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTablesResponse' {Maybe Text
lastEvaluatedTableName :: Maybe Text
$sel:lastEvaluatedTableName:ListTablesResponse' :: ListTablesResponse -> Maybe Text
lastEvaluatedTableName} -> Maybe Text
lastEvaluatedTableName) (\s :: ListTablesResponse
s@ListTablesResponse' {} Maybe Text
a -> ListTablesResponse
s {$sel:lastEvaluatedTableName:ListTablesResponse' :: Maybe Text
lastEvaluatedTableName = Maybe Text
a} :: ListTablesResponse)

-- | The names of the tables associated with the current account at the
-- current endpoint. The maximum size of this array is 100.
--
-- If @LastEvaluatedTableName@ also appears in the output, you can use this
-- value as the @ExclusiveStartTableName@ parameter in a subsequent
-- @ListTables@ request and obtain the next page of results.
listTablesResponse_tableNames :: Lens.Lens' ListTablesResponse (Prelude.Maybe [Prelude.Text])
listTablesResponse_tableNames :: (Maybe [Text] -> f (Maybe [Text]))
-> ListTablesResponse -> f ListTablesResponse
listTablesResponse_tableNames = (ListTablesResponse -> Maybe [Text])
-> (ListTablesResponse -> Maybe [Text] -> ListTablesResponse)
-> Lens' ListTablesResponse (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTablesResponse' {Maybe [Text]
tableNames :: Maybe [Text]
$sel:tableNames:ListTablesResponse' :: ListTablesResponse -> Maybe [Text]
tableNames} -> Maybe [Text]
tableNames) (\s :: ListTablesResponse
s@ListTablesResponse' {} Maybe [Text]
a -> ListTablesResponse
s {$sel:tableNames:ListTablesResponse' :: Maybe [Text]
tableNames = Maybe [Text]
a} :: ListTablesResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> ListTablesResponse -> f ListTablesResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ListTablesResponse
-> f ListTablesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListTablesResponse