{-# 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-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)
--
-- 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_nextToken,
    getTables_expression,
    getTables_maxResults,
    getTables_databaseName,

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

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

import qualified Amazonka.Core as Core
import Amazonka.Glue.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:/ '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 continuation token, included if this is a continuation call.
    GetTables -> Maybe Text
nextToken :: 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,
    -- | 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
(GetTables -> GetTables -> Bool)
-> (GetTables -> GetTables -> Bool) -> Eq GetTables
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]
(Int -> ReadS GetTables)
-> ReadS [GetTables]
-> ReadPrec GetTables
-> ReadPrec [GetTables]
-> Read 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
(Int -> GetTables -> ShowS)
-> (GetTables -> String)
-> ([GetTables] -> ShowS)
-> Show GetTables
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. GetTables -> Rep GetTables x)
-> (forall x. Rep GetTables x -> GetTables) -> Generic GetTables
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.
--
-- 'nextToken', 'getTables_nextToken' - A continuation token, included if this is a continuation call.
--
-- '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.
--
-- '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' :: Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Natural -> Text -> GetTables
GetTables'
    { $sel:catalogId:GetTables' :: Maybe Text
catalogId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetTables' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:expression:GetTables' :: Maybe Text
expression = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:GetTables' :: Maybe Natural
maxResults = Maybe Natural
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 :: (Maybe Text -> f (Maybe Text)) -> GetTables -> f GetTables
getTables_catalogId = (GetTables -> Maybe Text)
-> (GetTables -> Maybe Text -> GetTables)
-> Lens GetTables GetTables (Maybe Text) (Maybe Text)
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 continuation token, included if this is a continuation call.
getTables_nextToken :: Lens.Lens' GetTables (Prelude.Maybe Prelude.Text)
getTables_nextToken :: (Maybe Text -> f (Maybe Text)) -> GetTables -> f GetTables
getTables_nextToken = (GetTables -> Maybe Text)
-> (GetTables -> Maybe Text -> GetTables)
-> Lens GetTables GetTables (Maybe Text) (Maybe Text)
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)

-- | 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 :: (Maybe Text -> f (Maybe Text)) -> GetTables -> f GetTables
getTables_expression = (GetTables -> Maybe Text)
-> (GetTables -> Maybe Text -> GetTables)
-> Lens GetTables GetTables (Maybe Text) (Maybe Text)
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 :: (Maybe Natural -> f (Maybe Natural)) -> GetTables -> f GetTables
getTables_maxResults = (GetTables -> Maybe Natural)
-> (GetTables -> Maybe Natural -> GetTables)
-> Lens GetTables GetTables (Maybe Natural) (Maybe Natural)
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)

-- | 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 :: (Text -> f Text) -> GetTables -> f GetTables
getTables_databaseName = (GetTables -> Text)
-> (GetTables -> Text -> GetTables)
-> Lens GetTables GetTables Text Text
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
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetTables
GetTablesResponse
rs
            GetTablesResponse
-> Getting (First Text) GetTablesResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> GetTablesResponse -> Const (First Text) GetTablesResponse
Lens' GetTablesResponse (Maybe Text)
getTablesResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> GetTablesResponse -> Const (First Text) GetTablesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) GetTablesResponse 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 GetTables
forall a. Maybe a
Prelude.Nothing
    | Maybe [Table] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetTables
GetTablesResponse
rs
            GetTablesResponse
-> Getting (First [Table]) GetTablesResponse [Table]
-> Maybe [Table]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [Table] -> Const (First [Table]) (Maybe [Table]))
-> GetTablesResponse -> Const (First [Table]) GetTablesResponse
Lens' GetTablesResponse (Maybe [Table])
getTablesResponse_tableList ((Maybe [Table] -> Const (First [Table]) (Maybe [Table]))
 -> GetTablesResponse -> Const (First [Table]) GetTablesResponse)
-> (([Table] -> Const (First [Table]) [Table])
    -> Maybe [Table] -> Const (First [Table]) (Maybe [Table]))
-> Getting (First [Table]) GetTablesResponse [Table]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Table] -> Const (First [Table]) [Table])
-> Maybe [Table] -> Const (First [Table]) (Maybe [Table])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe GetTables
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      GetTables -> Maybe GetTables
forall a. a -> Maybe a
Prelude.Just (GetTables -> Maybe GetTables) -> GetTables -> Maybe GetTables
forall a b. (a -> b) -> a -> b
Prelude.$
        GetTables
rq
          GetTables -> (GetTables -> GetTables) -> GetTables
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> GetTables -> Identity GetTables
Lens GetTables GetTables (Maybe Text) (Maybe Text)
getTables_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> GetTables -> Identity GetTables)
-> Maybe Text -> GetTables -> GetTables
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse GetTables
GetTablesResponse
rs
          GetTablesResponse
-> Getting (First Text) GetTablesResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> GetTablesResponse -> Const (First Text) GetTablesResponse
Lens' GetTablesResponse (Maybe Text)
getTablesResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> GetTablesResponse -> Const (First Text) GetTablesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) GetTablesResponse 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 GetTables where
  type AWSResponse GetTables = GetTablesResponse
  request :: GetTables -> Request GetTables
request = Service -> GetTables -> Request GetTables
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GetTables
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetTables)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetTables))
-> Logger
-> Service
-> Proxy GetTables
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetTables)))
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 [Table] -> Maybe Text -> Int -> GetTablesResponse
GetTablesResponse'
            (Maybe [Table] -> Maybe Text -> Int -> GetTablesResponse)
-> Either String (Maybe [Table])
-> Either String (Maybe Text -> Int -> GetTablesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [Table]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"TableList" Either String (Maybe (Maybe [Table]))
-> Maybe [Table] -> Either String (Maybe [Table])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Table]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Maybe Text -> Int -> GetTablesResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetTablesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextToken")
            Either String (Int -> GetTablesResponse)
-> Either String Int -> Either String GetTablesResponse
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 GetTables

instance Prelude.NFData GetTables

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

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

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

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

-- | /See:/ 'newGetTablesResponse' smart constructor.
data GetTablesResponse = GetTablesResponse'
  { -- | A list of the requested @Table@ objects.
    GetTablesResponse -> Maybe [Table]
tableList :: Prelude.Maybe [Table],
    -- | A continuation token, present if the current list segment is not the
    -- last.
    GetTablesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetTablesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetTablesResponse -> GetTablesResponse -> Bool
(GetTablesResponse -> GetTablesResponse -> Bool)
-> (GetTablesResponse -> GetTablesResponse -> Bool)
-> Eq GetTablesResponse
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]
(Int -> ReadS GetTablesResponse)
-> ReadS [GetTablesResponse]
-> ReadPrec GetTablesResponse
-> ReadPrec [GetTablesResponse]
-> Read 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
(Int -> GetTablesResponse -> ShowS)
-> (GetTablesResponse -> String)
-> ([GetTablesResponse] -> ShowS)
-> Show GetTablesResponse
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. GetTablesResponse -> Rep GetTablesResponse x)
-> (forall x. Rep GetTablesResponse x -> GetTablesResponse)
-> Generic GetTablesResponse
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:
--
-- 'tableList', 'getTablesResponse_tableList' - A list of the requested @Table@ objects.
--
-- 'nextToken', 'getTablesResponse_nextToken' - A continuation token, present if the current list segment is not the
-- last.
--
-- 'httpStatus', 'getTablesResponse_httpStatus' - The response's http status code.
newGetTablesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetTablesResponse
newGetTablesResponse :: Int -> GetTablesResponse
newGetTablesResponse Int
pHttpStatus_ =
  GetTablesResponse' :: Maybe [Table] -> Maybe Text -> Int -> GetTablesResponse
GetTablesResponse'
    { $sel:tableList:GetTablesResponse' :: Maybe [Table]
tableList = Maybe [Table]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetTablesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetTablesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of the requested @Table@ objects.
getTablesResponse_tableList :: Lens.Lens' GetTablesResponse (Prelude.Maybe [Table])
getTablesResponse_tableList :: (Maybe [Table] -> f (Maybe [Table]))
-> GetTablesResponse -> f GetTablesResponse
getTablesResponse_tableList = (GetTablesResponse -> Maybe [Table])
-> (GetTablesResponse -> Maybe [Table] -> GetTablesResponse)
-> Lens' GetTablesResponse (Maybe [Table])
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) ((Maybe [Table] -> f (Maybe [Table]))
 -> GetTablesResponse -> f GetTablesResponse)
-> ((Maybe [Table] -> f (Maybe [Table]))
    -> Maybe [Table] -> f (Maybe [Table]))
-> (Maybe [Table] -> f (Maybe [Table]))
-> GetTablesResponse
-> f GetTablesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Table] [Table] [Table] [Table]
-> Iso
     (Maybe [Table]) (Maybe [Table]) (Maybe [Table]) (Maybe [Table])
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 [Table] [Table] [Table] [Table]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A continuation token, present if the current list segment is not the
-- last.
getTablesResponse_nextToken :: Lens.Lens' GetTablesResponse (Prelude.Maybe Prelude.Text)
getTablesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetTablesResponse -> f GetTablesResponse
getTablesResponse_nextToken = (GetTablesResponse -> Maybe Text)
-> (GetTablesResponse -> Maybe Text -> GetTablesResponse)
-> Lens' GetTablesResponse (Maybe Text)
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)

-- | The response's http status code.
getTablesResponse_httpStatus :: Lens.Lens' GetTablesResponse Prelude.Int
getTablesResponse_httpStatus :: (Int -> f Int) -> GetTablesResponse -> f GetTablesResponse
getTablesResponse_httpStatus = (GetTablesResponse -> Int)
-> (GetTablesResponse -> Int -> GetTablesResponse)
-> Lens GetTablesResponse GetTablesResponse Int Int
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