{-# 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.LakeFormation.GetTableObjects
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns the set of Amazon S3 objects that make up the specified governed
-- table. A transaction ID or timestamp can be specified for time-travel
-- queries.
module Amazonka.LakeFormation.GetTableObjects
  ( -- * Creating a Request
    GetTableObjects (..),
    newGetTableObjects,

    -- * Request Lenses
    getTableObjects_catalogId,
    getTableObjects_maxResults,
    getTableObjects_nextToken,
    getTableObjects_partitionPredicate,
    getTableObjects_queryAsOfTime,
    getTableObjects_transactionId,
    getTableObjects_databaseName,
    getTableObjects_tableName,

    -- * Destructuring the Response
    GetTableObjectsResponse (..),
    newGetTableObjectsResponse,

    -- * Response Lenses
    getTableObjectsResponse_nextToken,
    getTableObjectsResponse_objects,
    getTableObjectsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newGetTableObjects' smart constructor.
data GetTableObjects = GetTableObjects'
  { -- | The catalog containing the governed table. Defaults to the caller’s
    -- account.
    GetTableObjects -> Maybe Text
catalogId :: Prelude.Maybe Prelude.Text,
    -- | Specifies how many values to return in a page.
    GetTableObjects -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | A continuation token if this is not the first call to retrieve these
    -- objects.
    GetTableObjects -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A predicate to filter the objects returned based on the partition keys
    -- defined in the governed table.
    --
    -- -   The comparison operators supported are: =, >, \<, >=, \<=
    --
    -- -   The logical operators supported are: AND
    --
    -- -   The data types supported are integer, long, date(yyyy-MM-dd),
    --     timestamp(yyyy-MM-dd HH:mm:ssXXX or yyyy-MM-dd HH:mm:ss\"), string
    --     and decimal.
    GetTableObjects -> Maybe Text
partitionPredicate :: Prelude.Maybe Prelude.Text,
    -- | The time as of when to read the governed table contents. If not set, the
    -- most recent transaction commit time is used. Cannot be specified along
    -- with @TransactionId@.
    GetTableObjects -> Maybe POSIX
queryAsOfTime :: Prelude.Maybe Data.POSIX,
    -- | The transaction ID at which to read the governed table contents. If this
    -- transaction has aborted, an error is returned. If not set, defaults to
    -- the most recent committed transaction. Cannot be specified along with
    -- @QueryAsOfTime@.
    GetTableObjects -> Maybe Text
transactionId :: Prelude.Maybe Prelude.Text,
    -- | The database containing the governed table.
    GetTableObjects -> Text
databaseName :: Prelude.Text,
    -- | The governed table for which to retrieve objects.
    GetTableObjects -> Text
tableName :: Prelude.Text
  }
  deriving (GetTableObjects -> GetTableObjects -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetTableObjects -> GetTableObjects -> Bool
$c/= :: GetTableObjects -> GetTableObjects -> Bool
== :: GetTableObjects -> GetTableObjects -> Bool
$c== :: GetTableObjects -> GetTableObjects -> Bool
Prelude.Eq, ReadPrec [GetTableObjects]
ReadPrec GetTableObjects
Int -> ReadS GetTableObjects
ReadS [GetTableObjects]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetTableObjects]
$creadListPrec :: ReadPrec [GetTableObjects]
readPrec :: ReadPrec GetTableObjects
$creadPrec :: ReadPrec GetTableObjects
readList :: ReadS [GetTableObjects]
$creadList :: ReadS [GetTableObjects]
readsPrec :: Int -> ReadS GetTableObjects
$creadsPrec :: Int -> ReadS GetTableObjects
Prelude.Read, Int -> GetTableObjects -> ShowS
[GetTableObjects] -> ShowS
GetTableObjects -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetTableObjects] -> ShowS
$cshowList :: [GetTableObjects] -> ShowS
show :: GetTableObjects -> String
$cshow :: GetTableObjects -> String
showsPrec :: Int -> GetTableObjects -> ShowS
$cshowsPrec :: Int -> GetTableObjects -> ShowS
Prelude.Show, forall x. Rep GetTableObjects x -> GetTableObjects
forall x. GetTableObjects -> Rep GetTableObjects x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetTableObjects x -> GetTableObjects
$cfrom :: forall x. GetTableObjects -> Rep GetTableObjects x
Prelude.Generic)

-- |
-- Create a value of 'GetTableObjects' 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', 'getTableObjects_catalogId' - The catalog containing the governed table. Defaults to the caller’s
-- account.
--
-- 'maxResults', 'getTableObjects_maxResults' - Specifies how many values to return in a page.
--
-- 'nextToken', 'getTableObjects_nextToken' - A continuation token if this is not the first call to retrieve these
-- objects.
--
-- 'partitionPredicate', 'getTableObjects_partitionPredicate' - A predicate to filter the objects returned based on the partition keys
-- defined in the governed table.
--
-- -   The comparison operators supported are: =, >, \<, >=, \<=
--
-- -   The logical operators supported are: AND
--
-- -   The data types supported are integer, long, date(yyyy-MM-dd),
--     timestamp(yyyy-MM-dd HH:mm:ssXXX or yyyy-MM-dd HH:mm:ss\"), string
--     and decimal.
--
-- 'queryAsOfTime', 'getTableObjects_queryAsOfTime' - The time as of when to read the governed table contents. If not set, the
-- most recent transaction commit time is used. Cannot be specified along
-- with @TransactionId@.
--
-- 'transactionId', 'getTableObjects_transactionId' - The transaction ID at which to read the governed table contents. If this
-- transaction has aborted, an error is returned. If not set, defaults to
-- the most recent committed transaction. Cannot be specified along with
-- @QueryAsOfTime@.
--
-- 'databaseName', 'getTableObjects_databaseName' - The database containing the governed table.
--
-- 'tableName', 'getTableObjects_tableName' - The governed table for which to retrieve objects.
newGetTableObjects ::
  -- | 'databaseName'
  Prelude.Text ->
  -- | 'tableName'
  Prelude.Text ->
  GetTableObjects
newGetTableObjects :: Text -> Text -> GetTableObjects
newGetTableObjects Text
pDatabaseName_ Text
pTableName_ =
  GetTableObjects'
    { $sel:catalogId:GetTableObjects' :: Maybe Text
catalogId = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:GetTableObjects' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetTableObjects' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:partitionPredicate:GetTableObjects' :: Maybe Text
partitionPredicate = forall a. Maybe a
Prelude.Nothing,
      $sel:queryAsOfTime:GetTableObjects' :: Maybe POSIX
queryAsOfTime = forall a. Maybe a
Prelude.Nothing,
      $sel:transactionId:GetTableObjects' :: Maybe Text
transactionId = forall a. Maybe a
Prelude.Nothing,
      $sel:databaseName:GetTableObjects' :: Text
databaseName = Text
pDatabaseName_,
      $sel:tableName:GetTableObjects' :: Text
tableName = Text
pTableName_
    }

-- | The catalog containing the governed table. Defaults to the caller’s
-- account.
getTableObjects_catalogId :: Lens.Lens' GetTableObjects (Prelude.Maybe Prelude.Text)
getTableObjects_catalogId :: Lens' GetTableObjects (Maybe Text)
getTableObjects_catalogId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTableObjects' {Maybe Text
catalogId :: Maybe Text
$sel:catalogId:GetTableObjects' :: GetTableObjects -> Maybe Text
catalogId} -> Maybe Text
catalogId) (\s :: GetTableObjects
s@GetTableObjects' {} Maybe Text
a -> GetTableObjects
s {$sel:catalogId:GetTableObjects' :: Maybe Text
catalogId = Maybe Text
a} :: GetTableObjects)

-- | Specifies how many values to return in a page.
getTableObjects_maxResults :: Lens.Lens' GetTableObjects (Prelude.Maybe Prelude.Natural)
getTableObjects_maxResults :: Lens' GetTableObjects (Maybe Natural)
getTableObjects_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTableObjects' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:GetTableObjects' :: GetTableObjects -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: GetTableObjects
s@GetTableObjects' {} Maybe Natural
a -> GetTableObjects
s {$sel:maxResults:GetTableObjects' :: Maybe Natural
maxResults = Maybe Natural
a} :: GetTableObjects)

-- | A continuation token if this is not the first call to retrieve these
-- objects.
getTableObjects_nextToken :: Lens.Lens' GetTableObjects (Prelude.Maybe Prelude.Text)
getTableObjects_nextToken :: Lens' GetTableObjects (Maybe Text)
getTableObjects_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTableObjects' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetTableObjects' :: GetTableObjects -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetTableObjects
s@GetTableObjects' {} Maybe Text
a -> GetTableObjects
s {$sel:nextToken:GetTableObjects' :: Maybe Text
nextToken = Maybe Text
a} :: GetTableObjects)

-- | A predicate to filter the objects returned based on the partition keys
-- defined in the governed table.
--
-- -   The comparison operators supported are: =, >, \<, >=, \<=
--
-- -   The logical operators supported are: AND
--
-- -   The data types supported are integer, long, date(yyyy-MM-dd),
--     timestamp(yyyy-MM-dd HH:mm:ssXXX or yyyy-MM-dd HH:mm:ss\"), string
--     and decimal.
getTableObjects_partitionPredicate :: Lens.Lens' GetTableObjects (Prelude.Maybe Prelude.Text)
getTableObjects_partitionPredicate :: Lens' GetTableObjects (Maybe Text)
getTableObjects_partitionPredicate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTableObjects' {Maybe Text
partitionPredicate :: Maybe Text
$sel:partitionPredicate:GetTableObjects' :: GetTableObjects -> Maybe Text
partitionPredicate} -> Maybe Text
partitionPredicate) (\s :: GetTableObjects
s@GetTableObjects' {} Maybe Text
a -> GetTableObjects
s {$sel:partitionPredicate:GetTableObjects' :: Maybe Text
partitionPredicate = Maybe Text
a} :: GetTableObjects)

-- | The time as of when to read the governed table contents. If not set, the
-- most recent transaction commit time is used. Cannot be specified along
-- with @TransactionId@.
getTableObjects_queryAsOfTime :: Lens.Lens' GetTableObjects (Prelude.Maybe Prelude.UTCTime)
getTableObjects_queryAsOfTime :: Lens' GetTableObjects (Maybe UTCTime)
getTableObjects_queryAsOfTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTableObjects' {Maybe POSIX
queryAsOfTime :: Maybe POSIX
$sel:queryAsOfTime:GetTableObjects' :: GetTableObjects -> Maybe POSIX
queryAsOfTime} -> Maybe POSIX
queryAsOfTime) (\s :: GetTableObjects
s@GetTableObjects' {} Maybe POSIX
a -> GetTableObjects
s {$sel:queryAsOfTime:GetTableObjects' :: Maybe POSIX
queryAsOfTime = Maybe POSIX
a} :: GetTableObjects) 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 governed table contents. If this
-- transaction has aborted, an error is returned. If not set, defaults to
-- the most recent committed transaction. Cannot be specified along with
-- @QueryAsOfTime@.
getTableObjects_transactionId :: Lens.Lens' GetTableObjects (Prelude.Maybe Prelude.Text)
getTableObjects_transactionId :: Lens' GetTableObjects (Maybe Text)
getTableObjects_transactionId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTableObjects' {Maybe Text
transactionId :: Maybe Text
$sel:transactionId:GetTableObjects' :: GetTableObjects -> Maybe Text
transactionId} -> Maybe Text
transactionId) (\s :: GetTableObjects
s@GetTableObjects' {} Maybe Text
a -> GetTableObjects
s {$sel:transactionId:GetTableObjects' :: Maybe Text
transactionId = Maybe Text
a} :: GetTableObjects)

-- | The database containing the governed table.
getTableObjects_databaseName :: Lens.Lens' GetTableObjects Prelude.Text
getTableObjects_databaseName :: Lens' GetTableObjects Text
getTableObjects_databaseName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTableObjects' {Text
databaseName :: Text
$sel:databaseName:GetTableObjects' :: GetTableObjects -> Text
databaseName} -> Text
databaseName) (\s :: GetTableObjects
s@GetTableObjects' {} Text
a -> GetTableObjects
s {$sel:databaseName:GetTableObjects' :: Text
databaseName = Text
a} :: GetTableObjects)

-- | The governed table for which to retrieve objects.
getTableObjects_tableName :: Lens.Lens' GetTableObjects Prelude.Text
getTableObjects_tableName :: Lens' GetTableObjects Text
getTableObjects_tableName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTableObjects' {Text
tableName :: Text
$sel:tableName:GetTableObjects' :: GetTableObjects -> Text
tableName} -> Text
tableName) (\s :: GetTableObjects
s@GetTableObjects' {} Text
a -> GetTableObjects
s {$sel:tableName:GetTableObjects' :: Text
tableName = Text
a} :: GetTableObjects)

instance Core.AWSRequest GetTableObjects where
  type
    AWSResponse GetTableObjects =
      GetTableObjectsResponse
  request :: (Service -> Service) -> GetTableObjects -> Request GetTableObjects
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 GetTableObjects
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetTableObjects)))
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 [PartitionObjects] -> Int -> GetTableObjectsResponse
GetTableObjectsResponse'
            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
"Objects" 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 GetTableObjects where
  hashWithSalt :: Int -> GetTableObjects -> Int
hashWithSalt Int
_salt GetTableObjects' {Maybe Natural
Maybe Text
Maybe POSIX
Text
tableName :: Text
databaseName :: Text
transactionId :: Maybe Text
queryAsOfTime :: Maybe POSIX
partitionPredicate :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
catalogId :: Maybe Text
$sel:tableName:GetTableObjects' :: GetTableObjects -> Text
$sel:databaseName:GetTableObjects' :: GetTableObjects -> Text
$sel:transactionId:GetTableObjects' :: GetTableObjects -> Maybe Text
$sel:queryAsOfTime:GetTableObjects' :: GetTableObjects -> Maybe POSIX
$sel:partitionPredicate:GetTableObjects' :: GetTableObjects -> Maybe Text
$sel:nextToken:GetTableObjects' :: GetTableObjects -> Maybe Text
$sel:maxResults:GetTableObjects' :: GetTableObjects -> Maybe Natural
$sel:catalogId:GetTableObjects' :: GetTableObjects -> 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 Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
partitionPredicate
      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
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
tableName

instance Prelude.NFData GetTableObjects where
  rnf :: GetTableObjects -> ()
rnf GetTableObjects' {Maybe Natural
Maybe Text
Maybe POSIX
Text
tableName :: Text
databaseName :: Text
transactionId :: Maybe Text
queryAsOfTime :: Maybe POSIX
partitionPredicate :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
catalogId :: Maybe Text
$sel:tableName:GetTableObjects' :: GetTableObjects -> Text
$sel:databaseName:GetTableObjects' :: GetTableObjects -> Text
$sel:transactionId:GetTableObjects' :: GetTableObjects -> Maybe Text
$sel:queryAsOfTime:GetTableObjects' :: GetTableObjects -> Maybe POSIX
$sel:partitionPredicate:GetTableObjects' :: GetTableObjects -> Maybe Text
$sel:nextToken:GetTableObjects' :: GetTableObjects -> Maybe Text
$sel:maxResults:GetTableObjects' :: GetTableObjects -> Maybe Natural
$sel:catalogId:GetTableObjects' :: GetTableObjects -> 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 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 Text
partitionPredicate
      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
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
tableName

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

instance Data.ToJSON GetTableObjects where
  toJSON :: GetTableObjects -> Value
toJSON GetTableObjects' {Maybe Natural
Maybe Text
Maybe POSIX
Text
tableName :: Text
databaseName :: Text
transactionId :: Maybe Text
queryAsOfTime :: Maybe POSIX
partitionPredicate :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
catalogId :: Maybe Text
$sel:tableName:GetTableObjects' :: GetTableObjects -> Text
$sel:databaseName:GetTableObjects' :: GetTableObjects -> Text
$sel:transactionId:GetTableObjects' :: GetTableObjects -> Maybe Text
$sel:queryAsOfTime:GetTableObjects' :: GetTableObjects -> Maybe POSIX
$sel:partitionPredicate:GetTableObjects' :: GetTableObjects -> Maybe Text
$sel:nextToken:GetTableObjects' :: GetTableObjects -> Maybe Text
$sel:maxResults:GetTableObjects' :: GetTableObjects -> Maybe Natural
$sel:catalogId:GetTableObjects' :: GetTableObjects -> 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
"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
"PartitionPredicate" 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
partitionPredicate,
            (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),
            forall a. a -> Maybe a
Prelude.Just (Key
"TableName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
tableName)
          ]
      )

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

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

-- | /See:/ 'newGetTableObjectsResponse' smart constructor.
data GetTableObjectsResponse = GetTableObjectsResponse'
  { -- | A continuation token indicating whether additional data is available.
    GetTableObjectsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of objects organized by partition keys.
    GetTableObjectsResponse -> Maybe [PartitionObjects]
objects :: Prelude.Maybe [PartitionObjects],
    -- | The response's http status code.
    GetTableObjectsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetTableObjectsResponse -> GetTableObjectsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetTableObjectsResponse -> GetTableObjectsResponse -> Bool
$c/= :: GetTableObjectsResponse -> GetTableObjectsResponse -> Bool
== :: GetTableObjectsResponse -> GetTableObjectsResponse -> Bool
$c== :: GetTableObjectsResponse -> GetTableObjectsResponse -> Bool
Prelude.Eq, ReadPrec [GetTableObjectsResponse]
ReadPrec GetTableObjectsResponse
Int -> ReadS GetTableObjectsResponse
ReadS [GetTableObjectsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetTableObjectsResponse]
$creadListPrec :: ReadPrec [GetTableObjectsResponse]
readPrec :: ReadPrec GetTableObjectsResponse
$creadPrec :: ReadPrec GetTableObjectsResponse
readList :: ReadS [GetTableObjectsResponse]
$creadList :: ReadS [GetTableObjectsResponse]
readsPrec :: Int -> ReadS GetTableObjectsResponse
$creadsPrec :: Int -> ReadS GetTableObjectsResponse
Prelude.Read, Int -> GetTableObjectsResponse -> ShowS
[GetTableObjectsResponse] -> ShowS
GetTableObjectsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetTableObjectsResponse] -> ShowS
$cshowList :: [GetTableObjectsResponse] -> ShowS
show :: GetTableObjectsResponse -> String
$cshow :: GetTableObjectsResponse -> String
showsPrec :: Int -> GetTableObjectsResponse -> ShowS
$cshowsPrec :: Int -> GetTableObjectsResponse -> ShowS
Prelude.Show, forall x. Rep GetTableObjectsResponse x -> GetTableObjectsResponse
forall x. GetTableObjectsResponse -> Rep GetTableObjectsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetTableObjectsResponse x -> GetTableObjectsResponse
$cfrom :: forall x. GetTableObjectsResponse -> Rep GetTableObjectsResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetTableObjectsResponse' 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', 'getTableObjectsResponse_nextToken' - A continuation token indicating whether additional data is available.
--
-- 'objects', 'getTableObjectsResponse_objects' - A list of objects organized by partition keys.
--
-- 'httpStatus', 'getTableObjectsResponse_httpStatus' - The response's http status code.
newGetTableObjectsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetTableObjectsResponse
newGetTableObjectsResponse :: Int -> GetTableObjectsResponse
newGetTableObjectsResponse Int
pHttpStatus_ =
  GetTableObjectsResponse'
    { $sel:nextToken:GetTableObjectsResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:objects:GetTableObjectsResponse' :: Maybe [PartitionObjects]
objects = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetTableObjectsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A continuation token indicating whether additional data is available.
getTableObjectsResponse_nextToken :: Lens.Lens' GetTableObjectsResponse (Prelude.Maybe Prelude.Text)
getTableObjectsResponse_nextToken :: Lens' GetTableObjectsResponse (Maybe Text)
getTableObjectsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTableObjectsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetTableObjectsResponse' :: GetTableObjectsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetTableObjectsResponse
s@GetTableObjectsResponse' {} Maybe Text
a -> GetTableObjectsResponse
s {$sel:nextToken:GetTableObjectsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetTableObjectsResponse)

-- | A list of objects organized by partition keys.
getTableObjectsResponse_objects :: Lens.Lens' GetTableObjectsResponse (Prelude.Maybe [PartitionObjects])
getTableObjectsResponse_objects :: Lens' GetTableObjectsResponse (Maybe [PartitionObjects])
getTableObjectsResponse_objects = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTableObjectsResponse' {Maybe [PartitionObjects]
objects :: Maybe [PartitionObjects]
$sel:objects:GetTableObjectsResponse' :: GetTableObjectsResponse -> Maybe [PartitionObjects]
objects} -> Maybe [PartitionObjects]
objects) (\s :: GetTableObjectsResponse
s@GetTableObjectsResponse' {} Maybe [PartitionObjects]
a -> GetTableObjectsResponse
s {$sel:objects:GetTableObjectsResponse' :: Maybe [PartitionObjects]
objects = Maybe [PartitionObjects]
a} :: GetTableObjectsResponse) 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.
getTableObjectsResponse_httpStatus :: Lens.Lens' GetTableObjectsResponse Prelude.Int
getTableObjectsResponse_httpStatus :: Lens' GetTableObjectsResponse Int
getTableObjectsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTableObjectsResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetTableObjectsResponse' :: GetTableObjectsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetTableObjectsResponse
s@GetTableObjectsResponse' {} Int
a -> GetTableObjectsResponse
s {$sel:httpStatus:GetTableObjectsResponse' :: Int
httpStatus = Int
a} :: GetTableObjectsResponse)

instance Prelude.NFData GetTableObjectsResponse where
  rnf :: GetTableObjectsResponse -> ()
rnf GetTableObjectsResponse' {Int
Maybe [PartitionObjects]
Maybe Text
httpStatus :: Int
objects :: Maybe [PartitionObjects]
nextToken :: Maybe Text
$sel:httpStatus:GetTableObjectsResponse' :: GetTableObjectsResponse -> Int
$sel:objects:GetTableObjectsResponse' :: GetTableObjectsResponse -> Maybe [PartitionObjects]
$sel:nextToken:GetTableObjectsResponse' :: GetTableObjectsResponse -> 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 [PartitionObjects]
objects
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus