{-# 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.Glue.GetTables
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Retrieves the definitions of some or all of the tables in a given
-- @Database@.
--
-- This operation returns paginated results.
module Amazonka.Glue.GetTables
  ( -- * Creating a Request
    GetTables (..),
    newGetTables,

    -- * Request Lenses
    getTables_catalogId,
    getTables_expression,
    getTables_maxResults,
    getTables_nextToken,
    getTables_queryAsOfTime,
    getTables_transactionId,
    getTables_databaseName,

    -- * Destructuring the Response
    GetTablesResponse (..),
    newGetTablesResponse,

    -- * Response Lenses
    getTablesResponse_nextToken,
    getTablesResponse_tableList,
    getTablesResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Glue.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newGetTables' smart constructor.
data GetTables = GetTables'
  { -- | The ID of the Data Catalog where the tables reside. If none is provided,
    -- the Amazon Web Services account ID is used by default.
    GetTables -> Maybe Text
catalogId :: Prelude.Maybe Prelude.Text,
    -- | A regular expression pattern. If present, only those tables whose names
    -- match the pattern are returned.
    GetTables -> Maybe Text
expression :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of tables to return in a single response.
    GetTables -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | A continuation token, included if this is a continuation call.
    GetTables -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The time as of when to read the table contents. If not set, the most
    -- recent transaction commit time will be used. Cannot be specified along
    -- with @TransactionId@.
    GetTables -> Maybe POSIX
queryAsOfTime :: Prelude.Maybe Data.POSIX,
    -- | The transaction ID at which to read the table contents.
    GetTables -> Maybe Text
transactionId :: Prelude.Maybe Prelude.Text,
    -- | The database in the catalog whose tables to list. For Hive
    -- compatibility, this name is entirely lowercase.
    GetTables -> Text
databaseName :: Prelude.Text
  }
  deriving (GetTables -> GetTables -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetTables -> GetTables -> Bool
$c/= :: GetTables -> GetTables -> Bool
== :: GetTables -> GetTables -> Bool
$c== :: GetTables -> GetTables -> Bool
Prelude.Eq, ReadPrec [GetTables]
ReadPrec GetTables
Int -> ReadS GetTables
ReadS [GetTables]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetTables]
$creadListPrec :: ReadPrec [GetTables]
readPrec :: ReadPrec GetTables
$creadPrec :: ReadPrec GetTables
readList :: ReadS [GetTables]
$creadList :: ReadS [GetTables]
readsPrec :: Int -> ReadS GetTables
$creadsPrec :: Int -> ReadS GetTables
Prelude.Read, Int -> GetTables -> ShowS
[GetTables] -> ShowS
GetTables -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetTables] -> ShowS
$cshowList :: [GetTables] -> ShowS
show :: GetTables -> String
$cshow :: GetTables -> String
showsPrec :: Int -> GetTables -> ShowS
$cshowsPrec :: Int -> GetTables -> ShowS
Prelude.Show, forall x. Rep GetTables x -> GetTables
forall x. GetTables -> Rep GetTables x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetTables x -> GetTables
$cfrom :: forall x. GetTables -> Rep GetTables x
Prelude.Generic)

-- |
-- Create a value of 'GetTables' 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', 'getTables_catalogId' - The ID of the Data Catalog where the tables reside. If none is provided,
-- the Amazon Web Services account ID is used by default.
--
-- 'expression', 'getTables_expression' - A regular expression pattern. If present, only those tables whose names
-- match the pattern are returned.
--
-- 'maxResults', 'getTables_maxResults' - The maximum number of tables to return in a single response.
--
-- 'nextToken', 'getTables_nextToken' - A continuation token, included if this is a continuation call.
--
-- 'queryAsOfTime', 'getTables_queryAsOfTime' - The time as of when to read the table contents. If not set, the most
-- recent transaction commit time will be used. Cannot be specified along
-- with @TransactionId@.
--
-- 'transactionId', 'getTables_transactionId' - The transaction ID at which to read the table contents.
--
-- 'databaseName', 'getTables_databaseName' - The database in the catalog whose tables to list. For Hive
-- compatibility, this name is entirely lowercase.
newGetTables ::
  -- | 'databaseName'
  Prelude.Text ->
  GetTables
newGetTables :: Text -> GetTables
newGetTables Text
pDatabaseName_ =
  GetTables'
    { $sel:catalogId:GetTables' :: Maybe Text
catalogId = forall a. Maybe a
Prelude.Nothing,
      $sel:expression:GetTables' :: Maybe Text
expression = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:GetTables' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetTables' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:queryAsOfTime:GetTables' :: Maybe POSIX
queryAsOfTime = forall a. Maybe a
Prelude.Nothing,
      $sel:transactionId:GetTables' :: Maybe Text
transactionId = forall a. Maybe a
Prelude.Nothing,
      $sel:databaseName:GetTables' :: Text
databaseName = Text
pDatabaseName_
    }

-- | The ID of the Data Catalog where the tables reside. If none is provided,
-- the Amazon Web Services account ID is used by default.
getTables_catalogId :: Lens.Lens' GetTables (Prelude.Maybe Prelude.Text)
getTables_catalogId :: Lens' GetTables (Maybe Text)
getTables_catalogId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTables' {Maybe Text
catalogId :: Maybe Text
$sel:catalogId:GetTables' :: GetTables -> Maybe Text
catalogId} -> Maybe Text
catalogId) (\s :: GetTables
s@GetTables' {} Maybe Text
a -> GetTables
s {$sel:catalogId:GetTables' :: Maybe Text
catalogId = Maybe Text
a} :: GetTables)

-- | A regular expression pattern. If present, only those tables whose names
-- match the pattern are returned.
getTables_expression :: Lens.Lens' GetTables (Prelude.Maybe Prelude.Text)
getTables_expression :: Lens' GetTables (Maybe Text)
getTables_expression = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTables' {Maybe Text
expression :: Maybe Text
$sel:expression:GetTables' :: GetTables -> Maybe Text
expression} -> Maybe Text
expression) (\s :: GetTables
s@GetTables' {} Maybe Text
a -> GetTables
s {$sel:expression:GetTables' :: Maybe Text
expression = Maybe Text
a} :: GetTables)

-- | The maximum number of tables to return in a single response.
getTables_maxResults :: Lens.Lens' GetTables (Prelude.Maybe Prelude.Natural)
getTables_maxResults :: Lens' GetTables (Maybe Natural)
getTables_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTables' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:GetTables' :: GetTables -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: GetTables
s@GetTables' {} Maybe Natural
a -> GetTables
s {$sel:maxResults:GetTables' :: Maybe Natural
maxResults = Maybe Natural
a} :: GetTables)

-- | A continuation token, included if this is a continuation call.
getTables_nextToken :: Lens.Lens' GetTables (Prelude.Maybe Prelude.Text)
getTables_nextToken :: Lens' GetTables (Maybe Text)
getTables_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTables' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetTables' :: GetTables -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetTables
s@GetTables' {} Maybe Text
a -> GetTables
s {$sel:nextToken:GetTables' :: Maybe Text
nextToken = Maybe Text
a} :: GetTables)

-- | The time as of when to read the table contents. If not set, the most
-- recent transaction commit time will be used. Cannot be specified along
-- with @TransactionId@.
getTables_queryAsOfTime :: Lens.Lens' GetTables (Prelude.Maybe Prelude.UTCTime)
getTables_queryAsOfTime :: Lens' GetTables (Maybe UTCTime)
getTables_queryAsOfTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTables' {Maybe POSIX
queryAsOfTime :: Maybe POSIX
$sel:queryAsOfTime:GetTables' :: GetTables -> Maybe POSIX
queryAsOfTime} -> Maybe POSIX
queryAsOfTime) (\s :: GetTables
s@GetTables' {} Maybe POSIX
a -> GetTables
s {$sel:queryAsOfTime:GetTables' :: Maybe POSIX
queryAsOfTime = Maybe POSIX
a} :: GetTables) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The transaction ID at which to read the table contents.
getTables_transactionId :: Lens.Lens' GetTables (Prelude.Maybe Prelude.Text)
getTables_transactionId :: Lens' GetTables (Maybe Text)
getTables_transactionId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTables' {Maybe Text
transactionId :: Maybe Text
$sel:transactionId:GetTables' :: GetTables -> Maybe Text
transactionId} -> Maybe Text
transactionId) (\s :: GetTables
s@GetTables' {} Maybe Text
a -> GetTables
s {$sel:transactionId:GetTables' :: Maybe Text
transactionId = Maybe Text
a} :: GetTables)

-- | The database in the catalog whose tables to list. For Hive
-- compatibility, this name is entirely lowercase.
getTables_databaseName :: Lens.Lens' GetTables Prelude.Text
getTables_databaseName :: Lens' GetTables Text
getTables_databaseName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTables' {Text
databaseName :: Text
$sel:databaseName:GetTables' :: GetTables -> Text
databaseName} -> Text
databaseName) (\s :: GetTables
s@GetTables' {} Text
a -> GetTables
s {$sel:databaseName:GetTables' :: Text
databaseName = Text
a} :: GetTables)

instance Core.AWSPager GetTables where
  page :: GetTables -> AWSResponse GetTables -> Maybe GetTables
page GetTables
rq AWSResponse GetTables
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetTables
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' GetTablesResponse (Maybe Text)
getTablesResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetTables
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' GetTablesResponse (Maybe [Table])
getTablesResponse_tableList
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ GetTables
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' GetTables (Maybe Text)
getTables_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse GetTables
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' GetTablesResponse (Maybe Text)
getTablesResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest GetTables where
  type AWSResponse GetTables = GetTablesResponse
  request :: (Service -> Service) -> GetTables -> Request GetTables
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetTables
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetTables)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text -> Maybe [Table] -> Int -> GetTablesResponse
GetTablesResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"TableList" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable GetTables where
  hashWithSalt :: Int -> GetTables -> Int
hashWithSalt Int
_salt GetTables' {Maybe Natural
Maybe Text
Maybe POSIX
Text
databaseName :: Text
transactionId :: Maybe Text
queryAsOfTime :: Maybe POSIX
nextToken :: Maybe Text
maxResults :: Maybe Natural
expression :: Maybe Text
catalogId :: Maybe Text
$sel:databaseName:GetTables' :: GetTables -> Text
$sel:transactionId:GetTables' :: GetTables -> Maybe Text
$sel:queryAsOfTime:GetTables' :: GetTables -> Maybe POSIX
$sel:nextToken:GetTables' :: GetTables -> Maybe Text
$sel:maxResults:GetTables' :: GetTables -> Maybe Natural
$sel:expression:GetTables' :: GetTables -> Maybe Text
$sel:catalogId:GetTables' :: GetTables -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
catalogId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
expression
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
queryAsOfTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
transactionId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
databaseName

instance Prelude.NFData GetTables where
  rnf :: GetTables -> ()
rnf GetTables' {Maybe Natural
Maybe Text
Maybe POSIX
Text
databaseName :: Text
transactionId :: Maybe Text
queryAsOfTime :: Maybe POSIX
nextToken :: Maybe Text
maxResults :: Maybe Natural
expression :: Maybe Text
catalogId :: Maybe Text
$sel:databaseName:GetTables' :: GetTables -> Text
$sel:transactionId:GetTables' :: GetTables -> Maybe Text
$sel:queryAsOfTime:GetTables' :: GetTables -> Maybe POSIX
$sel:nextToken:GetTables' :: GetTables -> Maybe Text
$sel:maxResults:GetTables' :: GetTables -> Maybe Natural
$sel:expression:GetTables' :: GetTables -> Maybe Text
$sel:catalogId:GetTables' :: GetTables -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
catalogId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
expression
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
queryAsOfTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
transactionId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
databaseName

instance Data.ToHeaders GetTables where
  toHeaders :: GetTables -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# (ByteString
"AWSGlue.GetTables" :: Prelude.ByteString),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON GetTables where
  toJSON :: GetTables -> Value
toJSON GetTables' {Maybe Natural
Maybe Text
Maybe POSIX
Text
databaseName :: Text
transactionId :: Maybe Text
queryAsOfTime :: Maybe POSIX
nextToken :: Maybe Text
maxResults :: Maybe Natural
expression :: Maybe Text
catalogId :: Maybe Text
$sel:databaseName:GetTables' :: GetTables -> Text
$sel:transactionId:GetTables' :: GetTables -> Maybe Text
$sel:queryAsOfTime:GetTables' :: GetTables -> Maybe POSIX
$sel:nextToken:GetTables' :: GetTables -> Maybe Text
$sel:maxResults:GetTables' :: GetTables -> Maybe Natural
$sel:expression:GetTables' :: GetTables -> Maybe Text
$sel:catalogId:GetTables' :: GetTables -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"CatalogId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
catalogId,
            (Key
"Expression" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
expression,
            (Key
"MaxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            (Key
"NextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Key
"QueryAsOfTime" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
queryAsOfTime,
            (Key
"TransactionId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
transactionId,
            forall a. a -> Maybe a
Prelude.Just (Key
"DatabaseName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
databaseName)
          ]
      )

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

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

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

-- |
-- Create a value of 'GetTablesResponse' 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', 'getTablesResponse_nextToken' - A continuation token, present if the current list segment is not the
-- last.
--
-- 'tableList', 'getTablesResponse_tableList' - A list of the requested @Table@ objects.
--
-- 'httpStatus', 'getTablesResponse_httpStatus' - The response's http status code.
newGetTablesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetTablesResponse
newGetTablesResponse :: Int -> GetTablesResponse
newGetTablesResponse Int
pHttpStatus_ =
  GetTablesResponse'
    { $sel:nextToken:GetTablesResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:tableList:GetTablesResponse' :: Maybe [Table]
tableList = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetTablesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | A list of the requested @Table@ objects.
getTablesResponse_tableList :: Lens.Lens' GetTablesResponse (Prelude.Maybe [Table])
getTablesResponse_tableList :: Lens' GetTablesResponse (Maybe [Table])
getTablesResponse_tableList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTablesResponse' {Maybe [Table]
tableList :: Maybe [Table]
$sel:tableList:GetTablesResponse' :: GetTablesResponse -> Maybe [Table]
tableList} -> Maybe [Table]
tableList) (\s :: GetTablesResponse
s@GetTablesResponse' {} Maybe [Table]
a -> GetTablesResponse
s {$sel:tableList:GetTablesResponse' :: Maybe [Table]
tableList = Maybe [Table]
a} :: GetTablesResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData GetTablesResponse where
  rnf :: GetTablesResponse -> ()
rnf GetTablesResponse' {Int
Maybe [Table]
Maybe Text
httpStatus :: Int
tableList :: Maybe [Table]
nextToken :: Maybe Text
$sel:httpStatus:GetTablesResponse' :: GetTablesResponse -> Int
$sel:tableList:GetTablesResponse' :: GetTablesResponse -> Maybe [Table]
$sel:nextToken:GetTablesResponse' :: GetTablesResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Table]
tableList
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus