{-# 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.HoneyCode.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)
--
-- The ListTables API allows you to retrieve a list of all the tables in a
-- workbook.
--
-- This operation returns paginated results.
module Amazonka.HoneyCode.ListTables
  ( -- * Creating a Request
    ListTables (..),
    newListTables,

    -- * Request Lenses
    listTables_nextToken,
    listTables_maxResults,
    listTables_workbookId,

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

    -- * Response Lenses
    listTablesResponse_nextToken,
    listTablesResponse_workbookCursor,
    listTablesResponse_httpStatus,
    listTablesResponse_tables,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.HoneyCode.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:/ 'newListTables' smart constructor.
data ListTables = ListTables'
  { -- | This parameter is optional. If a nextToken is not specified, the API
    -- returns the first page of data.
    --
    -- Pagination tokens expire after 1 hour. If you use a token that was
    -- returned more than an hour back, the API will throw ValidationException.
    ListTables -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of tables to return in each page of the results.
    ListTables -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The ID of the workbook whose tables are being retrieved.
    --
    -- If a workbook with the specified id could not be found, this API throws
    -- ResourceNotFoundException.
    ListTables -> Text
workbookId :: Prelude.Text
  }
  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:
--
-- 'nextToken', 'listTables_nextToken' - This parameter is optional. If a nextToken is not specified, the API
-- returns the first page of data.
--
-- Pagination tokens expire after 1 hour. If you use a token that was
-- returned more than an hour back, the API will throw ValidationException.
--
-- 'maxResults', 'listTables_maxResults' - The maximum number of tables to return in each page of the results.
--
-- 'workbookId', 'listTables_workbookId' - The ID of the workbook whose tables are being retrieved.
--
-- If a workbook with the specified id could not be found, this API throws
-- ResourceNotFoundException.
newListTables ::
  -- | 'workbookId'
  Prelude.Text ->
  ListTables
newListTables :: Text -> ListTables
newListTables Text
pWorkbookId_ =
  ListTables' :: Maybe Text -> Maybe Natural -> Text -> ListTables
ListTables'
    { $sel:nextToken:ListTables' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListTables' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:workbookId:ListTables' :: Text
workbookId = Text
pWorkbookId_
    }

-- | This parameter is optional. If a nextToken is not specified, the API
-- returns the first page of data.
--
-- Pagination tokens expire after 1 hour. If you use a token that was
-- returned more than an hour back, the API will throw ValidationException.
listTables_nextToken :: Lens.Lens' ListTables (Prelude.Maybe Prelude.Text)
listTables_nextToken :: (Maybe Text -> f (Maybe Text)) -> ListTables -> f ListTables
listTables_nextToken = (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
nextToken :: Maybe Text
$sel:nextToken:ListTables' :: ListTables -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListTables
s@ListTables' {} Maybe Text
a -> ListTables
s {$sel:nextToken:ListTables' :: Maybe Text
nextToken = Maybe Text
a} :: ListTables)

-- | The maximum number of tables to return in each page of the results.
listTables_maxResults :: Lens.Lens' ListTables (Prelude.Maybe Prelude.Natural)
listTables_maxResults :: (Maybe Natural -> f (Maybe Natural)) -> ListTables -> f ListTables
listTables_maxResults = (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
maxResults :: Maybe Natural
$sel:maxResults:ListTables' :: ListTables -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListTables
s@ListTables' {} Maybe Natural
a -> ListTables
s {$sel:maxResults:ListTables' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListTables)

-- | The ID of the workbook whose tables are being retrieved.
--
-- If a workbook with the specified id could not be found, this API throws
-- ResourceNotFoundException.
listTables_workbookId :: Lens.Lens' ListTables Prelude.Text
listTables_workbookId :: (Text -> f Text) -> ListTables -> f ListTables
listTables_workbookId = (ListTables -> Text)
-> (ListTables -> Text -> ListTables)
-> Lens ListTables ListTables Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTables' {Text
workbookId :: Text
$sel:workbookId:ListTables' :: ListTables -> Text
workbookId} -> Text
workbookId) (\s :: ListTables
s@ListTables' {} Text
a -> ListTables
s {$sel:workbookId:ListTables' :: Text
workbookId = Text
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_nextToken ((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
    | [Table] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop (AWSResponse ListTables
ListTablesResponse
rs ListTablesResponse
-> Getting [Table] ListTablesResponse [Table] -> [Table]
forall s a. s -> Getting a s a -> a
Lens.^. Getting [Table] ListTablesResponse [Table]
Lens' ListTablesResponse [Table]
listTablesResponse_tables) =
      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_nextToken
          ((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_nextToken ((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 => Service -> a -> Request a
Request.get 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 Integer -> Int -> [Table] -> ListTablesResponse
ListTablesResponse'
            (Maybe Text
 -> Maybe Integer -> Int -> [Table] -> ListTablesResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Integer -> Int -> [Table] -> 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
"nextToken")
            Either
  String (Maybe Integer -> Int -> [Table] -> ListTablesResponse)
-> Either String (Maybe Integer)
-> Either String (Int -> [Table] -> ListTablesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"workbookCursor")
            Either String (Int -> [Table] -> ListTablesResponse)
-> Either String Int
-> Either String ([Table] -> 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))
            Either String ([Table] -> ListTablesResponse)
-> Either String [Table] -> Either String ListTablesResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe [Table])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"tables" Either String (Maybe [Table]) -> [Table] -> Either String [Table]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Table]
forall a. Monoid a => a
Prelude.mempty)
      )

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
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToPath ListTables where
  toPath :: ListTables -> ByteString
toPath ListTables' {Maybe Natural
Maybe Text
Text
workbookId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:workbookId:ListTables' :: ListTables -> Text
$sel:maxResults:ListTables' :: ListTables -> Maybe Natural
$sel:nextToken:ListTables' :: ListTables -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/workbooks/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
workbookId, ByteString
"/tables"]

instance Core.ToQuery ListTables where
  toQuery :: ListTables -> QueryString
toQuery ListTables' {Maybe Natural
Maybe Text
Text
workbookId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:workbookId:ListTables' :: ListTables -> Text
$sel:maxResults:ListTables' :: ListTables -> Maybe Natural
$sel:nextToken:ListTables' :: ListTables -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"maxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | /See:/ 'newListTablesResponse' smart constructor.
data ListTablesResponse = ListTablesResponse'
  { -- | Provides the pagination token to load the next page if there are more
    -- results matching the request. If a pagination token is not present in
    -- the response, it means that all data matching the request has been
    -- loaded.
    ListTablesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Indicates the cursor of the workbook at which the data returned by this
    -- request is read. Workbook cursor keeps increasing with every update and
    -- the increments are not sequential.
    ListTablesResponse -> Maybe Integer
workbookCursor :: Prelude.Maybe Prelude.Integer,
    -- | The response's http status code.
    ListTablesResponse -> Int
httpStatus :: Prelude.Int,
    -- | The list of tables in the workbook.
    ListTablesResponse -> [Table]
tables :: [Table]
  }
  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:
--
-- 'nextToken', 'listTablesResponse_nextToken' - Provides the pagination token to load the next page if there are more
-- results matching the request. If a pagination token is not present in
-- the response, it means that all data matching the request has been
-- loaded.
--
-- 'workbookCursor', 'listTablesResponse_workbookCursor' - Indicates the cursor of the workbook at which the data returned by this
-- request is read. Workbook cursor keeps increasing with every update and
-- the increments are not sequential.
--
-- 'httpStatus', 'listTablesResponse_httpStatus' - The response's http status code.
--
-- 'tables', 'listTablesResponse_tables' - The list of tables in the workbook.
newListTablesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListTablesResponse
newListTablesResponse :: Int -> ListTablesResponse
newListTablesResponse Int
pHttpStatus_ =
  ListTablesResponse' :: Maybe Text -> Maybe Integer -> Int -> [Table] -> ListTablesResponse
ListTablesResponse'
    { $sel:nextToken:ListTablesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:workbookCursor:ListTablesResponse' :: Maybe Integer
workbookCursor = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListTablesResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:tables:ListTablesResponse' :: [Table]
tables = [Table]
forall a. Monoid a => a
Prelude.mempty
    }

-- | Provides the pagination token to load the next page if there are more
-- results matching the request. If a pagination token is not present in
-- the response, it means that all data matching the request has been
-- loaded.
listTablesResponse_nextToken :: Lens.Lens' ListTablesResponse (Prelude.Maybe Prelude.Text)
listTablesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListTablesResponse -> f ListTablesResponse
listTablesResponse_nextToken = (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
nextToken :: Maybe Text
$sel:nextToken:ListTablesResponse' :: ListTablesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListTablesResponse
s@ListTablesResponse' {} Maybe Text
a -> ListTablesResponse
s {$sel:nextToken:ListTablesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListTablesResponse)

-- | Indicates the cursor of the workbook at which the data returned by this
-- request is read. Workbook cursor keeps increasing with every update and
-- the increments are not sequential.
listTablesResponse_workbookCursor :: Lens.Lens' ListTablesResponse (Prelude.Maybe Prelude.Integer)
listTablesResponse_workbookCursor :: (Maybe Integer -> f (Maybe Integer))
-> ListTablesResponse -> f ListTablesResponse
listTablesResponse_workbookCursor = (ListTablesResponse -> Maybe Integer)
-> (ListTablesResponse -> Maybe Integer -> ListTablesResponse)
-> Lens
     ListTablesResponse
     ListTablesResponse
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTablesResponse' {Maybe Integer
workbookCursor :: Maybe Integer
$sel:workbookCursor:ListTablesResponse' :: ListTablesResponse -> Maybe Integer
workbookCursor} -> Maybe Integer
workbookCursor) (\s :: ListTablesResponse
s@ListTablesResponse' {} Maybe Integer
a -> ListTablesResponse
s {$sel:workbookCursor:ListTablesResponse' :: Maybe Integer
workbookCursor = Maybe Integer
a} :: ListTablesResponse)

-- | 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)

-- | The list of tables in the workbook.
listTablesResponse_tables :: Lens.Lens' ListTablesResponse [Table]
listTablesResponse_tables :: ([Table] -> f [Table])
-> ListTablesResponse -> f ListTablesResponse
listTablesResponse_tables = (ListTablesResponse -> [Table])
-> (ListTablesResponse -> [Table] -> ListTablesResponse)
-> Lens' ListTablesResponse [Table]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTablesResponse' {[Table]
tables :: [Table]
$sel:tables:ListTablesResponse' :: ListTablesResponse -> [Table]
tables} -> [Table]
tables) (\s :: ListTablesResponse
s@ListTablesResponse' {} [Table]
a -> ListTablesResponse
s {$sel:tables:ListTablesResponse' :: [Table]
tables = [Table]
a} :: ListTablesResponse) (([Table] -> f [Table])
 -> ListTablesResponse -> f ListTablesResponse)
-> (([Table] -> f [Table]) -> [Table] -> f [Table])
-> ([Table] -> f [Table])
-> ListTablesResponse
-> f ListTablesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Table] -> f [Table]) -> [Table] -> f [Table]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListTablesResponse