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

    -- * Request Lenses
    listTableColumns_nextToken,
    listTableColumns_workbookId,
    listTableColumns_tableId,

    -- * Destructuring the Response
    ListTableColumnsResponse (..),
    newListTableColumnsResponse,

    -- * Response Lenses
    listTableColumnsResponse_nextToken,
    listTableColumnsResponse_workbookCursor,
    listTableColumnsResponse_httpStatus,
    listTableColumnsResponse_tableColumns,
  )
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:/ 'newListTableColumns' smart constructor.
data ListTableColumns = ListTableColumns'
  { -- | 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.
    ListTableColumns -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The ID of the workbook that contains the table whose columns are being
    -- retrieved.
    --
    -- If a workbook with the specified id could not be found, this API throws
    -- ResourceNotFoundException.
    ListTableColumns -> Text
workbookId :: Prelude.Text,
    -- | The ID of the table whose columns are being retrieved.
    --
    -- If a table with the specified id could not be found, this API throws
    -- ResourceNotFoundException.
    ListTableColumns -> Text
tableId :: Prelude.Text
  }
  deriving (ListTableColumns -> ListTableColumns -> Bool
(ListTableColumns -> ListTableColumns -> Bool)
-> (ListTableColumns -> ListTableColumns -> Bool)
-> Eq ListTableColumns
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTableColumns -> ListTableColumns -> Bool
$c/= :: ListTableColumns -> ListTableColumns -> Bool
== :: ListTableColumns -> ListTableColumns -> Bool
$c== :: ListTableColumns -> ListTableColumns -> Bool
Prelude.Eq, ReadPrec [ListTableColumns]
ReadPrec ListTableColumns
Int -> ReadS ListTableColumns
ReadS [ListTableColumns]
(Int -> ReadS ListTableColumns)
-> ReadS [ListTableColumns]
-> ReadPrec ListTableColumns
-> ReadPrec [ListTableColumns]
-> Read ListTableColumns
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTableColumns]
$creadListPrec :: ReadPrec [ListTableColumns]
readPrec :: ReadPrec ListTableColumns
$creadPrec :: ReadPrec ListTableColumns
readList :: ReadS [ListTableColumns]
$creadList :: ReadS [ListTableColumns]
readsPrec :: Int -> ReadS ListTableColumns
$creadsPrec :: Int -> ReadS ListTableColumns
Prelude.Read, Int -> ListTableColumns -> ShowS
[ListTableColumns] -> ShowS
ListTableColumns -> String
(Int -> ListTableColumns -> ShowS)
-> (ListTableColumns -> String)
-> ([ListTableColumns] -> ShowS)
-> Show ListTableColumns
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTableColumns] -> ShowS
$cshowList :: [ListTableColumns] -> ShowS
show :: ListTableColumns -> String
$cshow :: ListTableColumns -> String
showsPrec :: Int -> ListTableColumns -> ShowS
$cshowsPrec :: Int -> ListTableColumns -> ShowS
Prelude.Show, (forall x. ListTableColumns -> Rep ListTableColumns x)
-> (forall x. Rep ListTableColumns x -> ListTableColumns)
-> Generic ListTableColumns
forall x. Rep ListTableColumns x -> ListTableColumns
forall x. ListTableColumns -> Rep ListTableColumns x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListTableColumns x -> ListTableColumns
$cfrom :: forall x. ListTableColumns -> Rep ListTableColumns x
Prelude.Generic)

-- |
-- Create a value of 'ListTableColumns' 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', 'listTableColumns_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.
--
-- 'workbookId', 'listTableColumns_workbookId' - The ID of the workbook that contains the table whose columns are being
-- retrieved.
--
-- If a workbook with the specified id could not be found, this API throws
-- ResourceNotFoundException.
--
-- 'tableId', 'listTableColumns_tableId' - The ID of the table whose columns are being retrieved.
--
-- If a table with the specified id could not be found, this API throws
-- ResourceNotFoundException.
newListTableColumns ::
  -- | 'workbookId'
  Prelude.Text ->
  -- | 'tableId'
  Prelude.Text ->
  ListTableColumns
newListTableColumns :: Text -> Text -> ListTableColumns
newListTableColumns Text
pWorkbookId_ Text
pTableId_ =
  ListTableColumns' :: Maybe Text -> Text -> Text -> ListTableColumns
ListTableColumns'
    { $sel:nextToken:ListTableColumns' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:workbookId:ListTableColumns' :: Text
workbookId = Text
pWorkbookId_,
      $sel:tableId:ListTableColumns' :: Text
tableId = Text
pTableId_
    }

-- | 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.
listTableColumns_nextToken :: Lens.Lens' ListTableColumns (Prelude.Maybe Prelude.Text)
listTableColumns_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListTableColumns -> f ListTableColumns
listTableColumns_nextToken = (ListTableColumns -> Maybe Text)
-> (ListTableColumns -> Maybe Text -> ListTableColumns)
-> Lens ListTableColumns ListTableColumns (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTableColumns' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListTableColumns' :: ListTableColumns -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListTableColumns
s@ListTableColumns' {} Maybe Text
a -> ListTableColumns
s {$sel:nextToken:ListTableColumns' :: Maybe Text
nextToken = Maybe Text
a} :: ListTableColumns)

-- | The ID of the workbook that contains the table whose columns are being
-- retrieved.
--
-- If a workbook with the specified id could not be found, this API throws
-- ResourceNotFoundException.
listTableColumns_workbookId :: Lens.Lens' ListTableColumns Prelude.Text
listTableColumns_workbookId :: (Text -> f Text) -> ListTableColumns -> f ListTableColumns
listTableColumns_workbookId = (ListTableColumns -> Text)
-> (ListTableColumns -> Text -> ListTableColumns)
-> Lens ListTableColumns ListTableColumns Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTableColumns' {Text
workbookId :: Text
$sel:workbookId:ListTableColumns' :: ListTableColumns -> Text
workbookId} -> Text
workbookId) (\s :: ListTableColumns
s@ListTableColumns' {} Text
a -> ListTableColumns
s {$sel:workbookId:ListTableColumns' :: Text
workbookId = Text
a} :: ListTableColumns)

-- | The ID of the table whose columns are being retrieved.
--
-- If a table with the specified id could not be found, this API throws
-- ResourceNotFoundException.
listTableColumns_tableId :: Lens.Lens' ListTableColumns Prelude.Text
listTableColumns_tableId :: (Text -> f Text) -> ListTableColumns -> f ListTableColumns
listTableColumns_tableId = (ListTableColumns -> Text)
-> (ListTableColumns -> Text -> ListTableColumns)
-> Lens ListTableColumns ListTableColumns Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTableColumns' {Text
tableId :: Text
$sel:tableId:ListTableColumns' :: ListTableColumns -> Text
tableId} -> Text
tableId) (\s :: ListTableColumns
s@ListTableColumns' {} Text
a -> ListTableColumns
s {$sel:tableId:ListTableColumns' :: Text
tableId = Text
a} :: ListTableColumns)

instance Core.AWSPager ListTableColumns where
  page :: ListTableColumns
-> AWSResponse ListTableColumns -> Maybe ListTableColumns
page ListTableColumns
rq AWSResponse ListTableColumns
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListTableColumns
ListTableColumnsResponse
rs
            ListTableColumnsResponse
-> Getting (First Text) ListTableColumnsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListTableColumnsResponse
-> Const (First Text) ListTableColumnsResponse
Lens' ListTableColumnsResponse (Maybe Text)
listTableColumnsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListTableColumnsResponse
 -> Const (First Text) ListTableColumnsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListTableColumnsResponse 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 ListTableColumns
forall a. Maybe a
Prelude.Nothing
    | [TableColumn] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        (AWSResponse ListTableColumns
ListTableColumnsResponse
rs ListTableColumnsResponse
-> Getting [TableColumn] ListTableColumnsResponse [TableColumn]
-> [TableColumn]
forall s a. s -> Getting a s a -> a
Lens.^. Getting [TableColumn] ListTableColumnsResponse [TableColumn]
Lens' ListTableColumnsResponse [TableColumn]
listTableColumnsResponse_tableColumns) =
      Maybe ListTableColumns
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListTableColumns -> Maybe ListTableColumns
forall a. a -> Maybe a
Prelude.Just (ListTableColumns -> Maybe ListTableColumns)
-> ListTableColumns -> Maybe ListTableColumns
forall a b. (a -> b) -> a -> b
Prelude.$
        ListTableColumns
rq
          ListTableColumns
-> (ListTableColumns -> ListTableColumns) -> ListTableColumns
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListTableColumns -> Identity ListTableColumns
Lens ListTableColumns ListTableColumns (Maybe Text) (Maybe Text)
listTableColumns_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListTableColumns -> Identity ListTableColumns)
-> Maybe Text -> ListTableColumns -> ListTableColumns
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListTableColumns
ListTableColumnsResponse
rs
          ListTableColumnsResponse
-> Getting (First Text) ListTableColumnsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListTableColumnsResponse
-> Const (First Text) ListTableColumnsResponse
Lens' ListTableColumnsResponse (Maybe Text)
listTableColumnsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListTableColumnsResponse
 -> Const (First Text) ListTableColumnsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListTableColumnsResponse 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 ListTableColumns where
  type
    AWSResponse ListTableColumns =
      ListTableColumnsResponse
  request :: ListTableColumns -> Request ListTableColumns
request = Service -> ListTableColumns -> Request ListTableColumns
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListTableColumns
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListTableColumns)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListTableColumns))
-> Logger
-> Service
-> Proxy ListTableColumns
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListTableColumns)))
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
-> [TableColumn]
-> ListTableColumnsResponse
ListTableColumnsResponse'
            (Maybe Text
 -> Maybe Integer
 -> Int
 -> [TableColumn]
 -> ListTableColumnsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Integer -> Int -> [TableColumn] -> ListTableColumnsResponse)
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 -> [TableColumn] -> ListTableColumnsResponse)
-> Either String (Maybe Integer)
-> Either String (Int -> [TableColumn] -> ListTableColumnsResponse)
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 -> [TableColumn] -> ListTableColumnsResponse)
-> Either String Int
-> Either String ([TableColumn] -> ListTableColumnsResponse)
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 ([TableColumn] -> ListTableColumnsResponse)
-> Either String [TableColumn]
-> Either String ListTableColumnsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe [TableColumn])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"tableColumns" Either String (Maybe [TableColumn])
-> [TableColumn] -> Either String [TableColumn]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [TableColumn]
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable ListTableColumns

instance Prelude.NFData ListTableColumns

instance Core.ToHeaders ListTableColumns where
  toHeaders :: ListTableColumns -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListTableColumns -> 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 ListTableColumns where
  toPath :: ListTableColumns -> ByteString
toPath ListTableColumns' {Maybe Text
Text
tableId :: Text
workbookId :: Text
nextToken :: Maybe Text
$sel:tableId:ListTableColumns' :: ListTableColumns -> Text
$sel:workbookId:ListTableColumns' :: ListTableColumns -> Text
$sel:nextToken:ListTableColumns' :: ListTableColumns -> 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/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
tableId,
        ByteString
"/columns"
      ]

instance Core.ToQuery ListTableColumns where
  toQuery :: ListTableColumns -> QueryString
toQuery ListTableColumns' {Maybe Text
Text
tableId :: Text
workbookId :: Text
nextToken :: Maybe Text
$sel:tableId:ListTableColumns' :: ListTableColumns -> Text
$sel:workbookId:ListTableColumns' :: ListTableColumns -> Text
$sel:nextToken:ListTableColumns' :: ListTableColumns -> 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]

-- | /See:/ 'newListTableColumnsResponse' smart constructor.
data ListTableColumnsResponse = ListTableColumnsResponse'
  { -- | 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.
    ListTableColumnsResponse -> 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.
    ListTableColumnsResponse -> Maybe Integer
workbookCursor :: Prelude.Maybe Prelude.Integer,
    -- | The response's http status code.
    ListTableColumnsResponse -> Int
httpStatus :: Prelude.Int,
    -- | The list of columns in the table.
    ListTableColumnsResponse -> [TableColumn]
tableColumns :: [TableColumn]
  }
  deriving (ListTableColumnsResponse -> ListTableColumnsResponse -> Bool
(ListTableColumnsResponse -> ListTableColumnsResponse -> Bool)
-> (ListTableColumnsResponse -> ListTableColumnsResponse -> Bool)
-> Eq ListTableColumnsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTableColumnsResponse -> ListTableColumnsResponse -> Bool
$c/= :: ListTableColumnsResponse -> ListTableColumnsResponse -> Bool
== :: ListTableColumnsResponse -> ListTableColumnsResponse -> Bool
$c== :: ListTableColumnsResponse -> ListTableColumnsResponse -> Bool
Prelude.Eq, ReadPrec [ListTableColumnsResponse]
ReadPrec ListTableColumnsResponse
Int -> ReadS ListTableColumnsResponse
ReadS [ListTableColumnsResponse]
(Int -> ReadS ListTableColumnsResponse)
-> ReadS [ListTableColumnsResponse]
-> ReadPrec ListTableColumnsResponse
-> ReadPrec [ListTableColumnsResponse]
-> Read ListTableColumnsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTableColumnsResponse]
$creadListPrec :: ReadPrec [ListTableColumnsResponse]
readPrec :: ReadPrec ListTableColumnsResponse
$creadPrec :: ReadPrec ListTableColumnsResponse
readList :: ReadS [ListTableColumnsResponse]
$creadList :: ReadS [ListTableColumnsResponse]
readsPrec :: Int -> ReadS ListTableColumnsResponse
$creadsPrec :: Int -> ReadS ListTableColumnsResponse
Prelude.Read, Int -> ListTableColumnsResponse -> ShowS
[ListTableColumnsResponse] -> ShowS
ListTableColumnsResponse -> String
(Int -> ListTableColumnsResponse -> ShowS)
-> (ListTableColumnsResponse -> String)
-> ([ListTableColumnsResponse] -> ShowS)
-> Show ListTableColumnsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTableColumnsResponse] -> ShowS
$cshowList :: [ListTableColumnsResponse] -> ShowS
show :: ListTableColumnsResponse -> String
$cshow :: ListTableColumnsResponse -> String
showsPrec :: Int -> ListTableColumnsResponse -> ShowS
$cshowsPrec :: Int -> ListTableColumnsResponse -> ShowS
Prelude.Show, (forall x.
 ListTableColumnsResponse -> Rep ListTableColumnsResponse x)
-> (forall x.
    Rep ListTableColumnsResponse x -> ListTableColumnsResponse)
-> Generic ListTableColumnsResponse
forall x.
Rep ListTableColumnsResponse x -> ListTableColumnsResponse
forall x.
ListTableColumnsResponse -> Rep ListTableColumnsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListTableColumnsResponse x -> ListTableColumnsResponse
$cfrom :: forall x.
ListTableColumnsResponse -> Rep ListTableColumnsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListTableColumnsResponse' 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', 'listTableColumnsResponse_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', 'listTableColumnsResponse_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', 'listTableColumnsResponse_httpStatus' - The response's http status code.
--
-- 'tableColumns', 'listTableColumnsResponse_tableColumns' - The list of columns in the table.
newListTableColumnsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListTableColumnsResponse
newListTableColumnsResponse :: Int -> ListTableColumnsResponse
newListTableColumnsResponse Int
pHttpStatus_ =
  ListTableColumnsResponse' :: Maybe Text
-> Maybe Integer
-> Int
-> [TableColumn]
-> ListTableColumnsResponse
ListTableColumnsResponse'
    { $sel:nextToken:ListTableColumnsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:workbookCursor:ListTableColumnsResponse' :: Maybe Integer
workbookCursor = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListTableColumnsResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:tableColumns:ListTableColumnsResponse' :: [TableColumn]
tableColumns = [TableColumn]
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.
listTableColumnsResponse_nextToken :: Lens.Lens' ListTableColumnsResponse (Prelude.Maybe Prelude.Text)
listTableColumnsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListTableColumnsResponse -> f ListTableColumnsResponse
listTableColumnsResponse_nextToken = (ListTableColumnsResponse -> Maybe Text)
-> (ListTableColumnsResponse
    -> Maybe Text -> ListTableColumnsResponse)
-> Lens' ListTableColumnsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTableColumnsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListTableColumnsResponse' :: ListTableColumnsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListTableColumnsResponse
s@ListTableColumnsResponse' {} Maybe Text
a -> ListTableColumnsResponse
s {$sel:nextToken:ListTableColumnsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListTableColumnsResponse)

-- | 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.
listTableColumnsResponse_workbookCursor :: Lens.Lens' ListTableColumnsResponse (Prelude.Maybe Prelude.Integer)
listTableColumnsResponse_workbookCursor :: (Maybe Integer -> f (Maybe Integer))
-> ListTableColumnsResponse -> f ListTableColumnsResponse
listTableColumnsResponse_workbookCursor = (ListTableColumnsResponse -> Maybe Integer)
-> (ListTableColumnsResponse
    -> Maybe Integer -> ListTableColumnsResponse)
-> Lens
     ListTableColumnsResponse
     ListTableColumnsResponse
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTableColumnsResponse' {Maybe Integer
workbookCursor :: Maybe Integer
$sel:workbookCursor:ListTableColumnsResponse' :: ListTableColumnsResponse -> Maybe Integer
workbookCursor} -> Maybe Integer
workbookCursor) (\s :: ListTableColumnsResponse
s@ListTableColumnsResponse' {} Maybe Integer
a -> ListTableColumnsResponse
s {$sel:workbookCursor:ListTableColumnsResponse' :: Maybe Integer
workbookCursor = Maybe Integer
a} :: ListTableColumnsResponse)

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

-- | The list of columns in the table.
listTableColumnsResponse_tableColumns :: Lens.Lens' ListTableColumnsResponse [TableColumn]
listTableColumnsResponse_tableColumns :: ([TableColumn] -> f [TableColumn])
-> ListTableColumnsResponse -> f ListTableColumnsResponse
listTableColumnsResponse_tableColumns = (ListTableColumnsResponse -> [TableColumn])
-> (ListTableColumnsResponse
    -> [TableColumn] -> ListTableColumnsResponse)
-> Lens' ListTableColumnsResponse [TableColumn]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTableColumnsResponse' {[TableColumn]
tableColumns :: [TableColumn]
$sel:tableColumns:ListTableColumnsResponse' :: ListTableColumnsResponse -> [TableColumn]
tableColumns} -> [TableColumn]
tableColumns) (\s :: ListTableColumnsResponse
s@ListTableColumnsResponse' {} [TableColumn]
a -> ListTableColumnsResponse
s {$sel:tableColumns:ListTableColumnsResponse' :: [TableColumn]
tableColumns = [TableColumn]
a} :: ListTableColumnsResponse) (([TableColumn] -> f [TableColumn])
 -> ListTableColumnsResponse -> f ListTableColumnsResponse)
-> (([TableColumn] -> f [TableColumn])
    -> [TableColumn] -> f [TableColumn])
-> ([TableColumn] -> f [TableColumn])
-> ListTableColumnsResponse
-> f ListTableColumnsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([TableColumn] -> f [TableColumn])
-> [TableColumn] -> f [TableColumn]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListTableColumnsResponse