{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.Table
-- 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)
module Amazonka.Glue.Types.Table where

import qualified Amazonka.Core as Core
import Amazonka.Glue.Types.Column
import Amazonka.Glue.Types.StorageDescriptor
import Amazonka.Glue.Types.TableIdentifier
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Represents a collection of related data organized in columns and rows.
--
-- /See:/ 'newTable' smart constructor.
data Table = Table'
  { -- | The retention time for this table.
    Table -> Maybe Natural
retention :: Prelude.Maybe Prelude.Natural,
    -- | A @TableIdentifier@ structure that describes a target table for resource
    -- linking.
    Table -> Maybe TableIdentifier
targetTable :: Prelude.Maybe TableIdentifier,
    -- | Indicates whether the table has been registered with Lake Formation.
    Table -> Maybe Bool
isRegisteredWithLakeFormation :: Prelude.Maybe Prelude.Bool,
    -- | The person or entity who created the table.
    Table -> Maybe Text
createdBy :: Prelude.Maybe Prelude.Text,
    -- | The type of this table (@EXTERNAL_TABLE@, @VIRTUAL_VIEW@, etc.).
    Table -> Maybe Text
tableType :: Prelude.Maybe Prelude.Text,
    -- | The ID of the Data Catalog in which the table resides.
    Table -> Maybe Text
catalogId :: Prelude.Maybe Prelude.Text,
    -- | The owner of the table.
    Table -> Maybe Text
owner :: Prelude.Maybe Prelude.Text,
    -- | If the table is a view, the original text of the view; otherwise @null@.
    Table -> Maybe Text
viewOriginalText :: Prelude.Maybe Prelude.Text,
    -- | The last time that the table was updated.
    Table -> Maybe POSIX
updateTime :: Prelude.Maybe Core.POSIX,
    -- | If the table is a view, the expanded text of the view; otherwise @null@.
    Table -> Maybe Text
viewExpandedText :: Prelude.Maybe Prelude.Text,
    -- | The last time that column statistics were computed for this table.
    Table -> Maybe POSIX
lastAnalyzedTime :: Prelude.Maybe Core.POSIX,
    -- | A storage descriptor containing information about the physical storage
    -- of this table.
    Table -> Maybe StorageDescriptor
storageDescriptor :: Prelude.Maybe StorageDescriptor,
    -- | The name of the database where the table metadata resides. For Hive
    -- compatibility, this must be all lowercase.
    Table -> Maybe Text
databaseName :: Prelude.Maybe Prelude.Text,
    -- | These key-value pairs define properties associated with the table.
    Table -> Maybe (HashMap Text Text)
parameters :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The last time that the table was accessed. This is usually taken from
    -- HDFS, and might not be reliable.
    Table -> Maybe POSIX
lastAccessTime :: Prelude.Maybe Core.POSIX,
    -- | A description of the table.
    Table -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | A list of columns by which the table is partitioned. Only primitive
    -- types are supported as partition keys.
    --
    -- When you create a table used by Amazon Athena, and you do not specify
    -- any @partitionKeys@, you must at least set the value of @partitionKeys@
    -- to an empty list. For example:
    --
    -- @\"PartitionKeys\": []@
    Table -> Maybe [Column]
partitionKeys :: Prelude.Maybe [Column],
    -- | The time when the table definition was created in the Data Catalog.
    Table -> Maybe POSIX
createTime :: Prelude.Maybe Core.POSIX,
    -- | The table name. For Hive compatibility, this must be entirely lowercase.
    Table -> Text
name :: Prelude.Text
  }
  deriving (Table -> Table -> Bool
(Table -> Table -> Bool) -> (Table -> Table -> Bool) -> Eq Table
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Table -> Table -> Bool
$c/= :: Table -> Table -> Bool
== :: Table -> Table -> Bool
$c== :: Table -> Table -> Bool
Prelude.Eq, ReadPrec [Table]
ReadPrec Table
Int -> ReadS Table
ReadS [Table]
(Int -> ReadS Table)
-> ReadS [Table]
-> ReadPrec Table
-> ReadPrec [Table]
-> Read Table
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Table]
$creadListPrec :: ReadPrec [Table]
readPrec :: ReadPrec Table
$creadPrec :: ReadPrec Table
readList :: ReadS [Table]
$creadList :: ReadS [Table]
readsPrec :: Int -> ReadS Table
$creadsPrec :: Int -> ReadS Table
Prelude.Read, Int -> Table -> ShowS
[Table] -> ShowS
Table -> String
(Int -> Table -> ShowS)
-> (Table -> String) -> ([Table] -> ShowS) -> Show Table
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Table] -> ShowS
$cshowList :: [Table] -> ShowS
show :: Table -> String
$cshow :: Table -> String
showsPrec :: Int -> Table -> ShowS
$cshowsPrec :: Int -> Table -> ShowS
Prelude.Show, (forall x. Table -> Rep Table x)
-> (forall x. Rep Table x -> Table) -> Generic Table
forall x. Rep Table x -> Table
forall x. Table -> Rep Table x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Table x -> Table
$cfrom :: forall x. Table -> Rep Table x
Prelude.Generic)

-- |
-- Create a value of 'Table' 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:
--
-- 'retention', 'table_retention' - The retention time for this table.
--
-- 'targetTable', 'table_targetTable' - A @TableIdentifier@ structure that describes a target table for resource
-- linking.
--
-- 'isRegisteredWithLakeFormation', 'table_isRegisteredWithLakeFormation' - Indicates whether the table has been registered with Lake Formation.
--
-- 'createdBy', 'table_createdBy' - The person or entity who created the table.
--
-- 'tableType', 'table_tableType' - The type of this table (@EXTERNAL_TABLE@, @VIRTUAL_VIEW@, etc.).
--
-- 'catalogId', 'table_catalogId' - The ID of the Data Catalog in which the table resides.
--
-- 'owner', 'table_owner' - The owner of the table.
--
-- 'viewOriginalText', 'table_viewOriginalText' - If the table is a view, the original text of the view; otherwise @null@.
--
-- 'updateTime', 'table_updateTime' - The last time that the table was updated.
--
-- 'viewExpandedText', 'table_viewExpandedText' - If the table is a view, the expanded text of the view; otherwise @null@.
--
-- 'lastAnalyzedTime', 'table_lastAnalyzedTime' - The last time that column statistics were computed for this table.
--
-- 'storageDescriptor', 'table_storageDescriptor' - A storage descriptor containing information about the physical storage
-- of this table.
--
-- 'databaseName', 'table_databaseName' - The name of the database where the table metadata resides. For Hive
-- compatibility, this must be all lowercase.
--
-- 'parameters', 'table_parameters' - These key-value pairs define properties associated with the table.
--
-- 'lastAccessTime', 'table_lastAccessTime' - The last time that the table was accessed. This is usually taken from
-- HDFS, and might not be reliable.
--
-- 'description', 'table_description' - A description of the table.
--
-- 'partitionKeys', 'table_partitionKeys' - A list of columns by which the table is partitioned. Only primitive
-- types are supported as partition keys.
--
-- When you create a table used by Amazon Athena, and you do not specify
-- any @partitionKeys@, you must at least set the value of @partitionKeys@
-- to an empty list. For example:
--
-- @\"PartitionKeys\": []@
--
-- 'createTime', 'table_createTime' - The time when the table definition was created in the Data Catalog.
--
-- 'name', 'table_name' - The table name. For Hive compatibility, this must be entirely lowercase.
newTable ::
  -- | 'name'
  Prelude.Text ->
  Table
newTable :: Text -> Table
newTable Text
pName_ =
  Table' :: Maybe Natural
-> Maybe TableIdentifier
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe StorageDescriptor
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe POSIX
-> Maybe Text
-> Maybe [Column]
-> Maybe POSIX
-> Text
-> Table
Table'
    { $sel:retention:Table' :: Maybe Natural
retention = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:targetTable:Table' :: Maybe TableIdentifier
targetTable = Maybe TableIdentifier
forall a. Maybe a
Prelude.Nothing,
      $sel:isRegisteredWithLakeFormation:Table' :: Maybe Bool
isRegisteredWithLakeFormation = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:createdBy:Table' :: Maybe Text
createdBy = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tableType:Table' :: Maybe Text
tableType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:catalogId:Table' :: Maybe Text
catalogId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:owner:Table' :: Maybe Text
owner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:viewOriginalText:Table' :: Maybe Text
viewOriginalText = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:updateTime:Table' :: Maybe POSIX
updateTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:viewExpandedText:Table' :: Maybe Text
viewExpandedText = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastAnalyzedTime:Table' :: Maybe POSIX
lastAnalyzedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:storageDescriptor:Table' :: Maybe StorageDescriptor
storageDescriptor = Maybe StorageDescriptor
forall a. Maybe a
Prelude.Nothing,
      $sel:databaseName:Table' :: Maybe Text
databaseName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:parameters:Table' :: Maybe (HashMap Text Text)
parameters = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:lastAccessTime:Table' :: Maybe POSIX
lastAccessTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:description:Table' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:partitionKeys:Table' :: Maybe [Column]
partitionKeys = Maybe [Column]
forall a. Maybe a
Prelude.Nothing,
      $sel:createTime:Table' :: Maybe POSIX
createTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:name:Table' :: Text
name = Text
pName_
    }

-- | The retention time for this table.
table_retention :: Lens.Lens' Table (Prelude.Maybe Prelude.Natural)
table_retention :: (Maybe Natural -> f (Maybe Natural)) -> Table -> f Table
table_retention = (Table -> Maybe Natural)
-> (Table -> Maybe Natural -> Table)
-> Lens Table Table (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Table' {Maybe Natural
retention :: Maybe Natural
$sel:retention:Table' :: Table -> Maybe Natural
retention} -> Maybe Natural
retention) (\s :: Table
s@Table' {} Maybe Natural
a -> Table
s {$sel:retention:Table' :: Maybe Natural
retention = Maybe Natural
a} :: Table)

-- | A @TableIdentifier@ structure that describes a target table for resource
-- linking.
table_targetTable :: Lens.Lens' Table (Prelude.Maybe TableIdentifier)
table_targetTable :: (Maybe TableIdentifier -> f (Maybe TableIdentifier))
-> Table -> f Table
table_targetTable = (Table -> Maybe TableIdentifier)
-> (Table -> Maybe TableIdentifier -> Table)
-> Lens Table Table (Maybe TableIdentifier) (Maybe TableIdentifier)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Table' {Maybe TableIdentifier
targetTable :: Maybe TableIdentifier
$sel:targetTable:Table' :: Table -> Maybe TableIdentifier
targetTable} -> Maybe TableIdentifier
targetTable) (\s :: Table
s@Table' {} Maybe TableIdentifier
a -> Table
s {$sel:targetTable:Table' :: Maybe TableIdentifier
targetTable = Maybe TableIdentifier
a} :: Table)

-- | Indicates whether the table has been registered with Lake Formation.
table_isRegisteredWithLakeFormation :: Lens.Lens' Table (Prelude.Maybe Prelude.Bool)
table_isRegisteredWithLakeFormation :: (Maybe Bool -> f (Maybe Bool)) -> Table -> f Table
table_isRegisteredWithLakeFormation = (Table -> Maybe Bool)
-> (Table -> Maybe Bool -> Table)
-> Lens Table Table (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Table' {Maybe Bool
isRegisteredWithLakeFormation :: Maybe Bool
$sel:isRegisteredWithLakeFormation:Table' :: Table -> Maybe Bool
isRegisteredWithLakeFormation} -> Maybe Bool
isRegisteredWithLakeFormation) (\s :: Table
s@Table' {} Maybe Bool
a -> Table
s {$sel:isRegisteredWithLakeFormation:Table' :: Maybe Bool
isRegisteredWithLakeFormation = Maybe Bool
a} :: Table)

-- | The person or entity who created the table.
table_createdBy :: Lens.Lens' Table (Prelude.Maybe Prelude.Text)
table_createdBy :: (Maybe Text -> f (Maybe Text)) -> Table -> f Table
table_createdBy = (Table -> Maybe Text)
-> (Table -> Maybe Text -> Table)
-> Lens Table Table (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Table' {Maybe Text
createdBy :: Maybe Text
$sel:createdBy:Table' :: Table -> Maybe Text
createdBy} -> Maybe Text
createdBy) (\s :: Table
s@Table' {} Maybe Text
a -> Table
s {$sel:createdBy:Table' :: Maybe Text
createdBy = Maybe Text
a} :: Table)

-- | The type of this table (@EXTERNAL_TABLE@, @VIRTUAL_VIEW@, etc.).
table_tableType :: Lens.Lens' Table (Prelude.Maybe Prelude.Text)
table_tableType :: (Maybe Text -> f (Maybe Text)) -> Table -> f Table
table_tableType = (Table -> Maybe Text)
-> (Table -> Maybe Text -> Table)
-> Lens Table Table (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Table' {Maybe Text
tableType :: Maybe Text
$sel:tableType:Table' :: Table -> Maybe Text
tableType} -> Maybe Text
tableType) (\s :: Table
s@Table' {} Maybe Text
a -> Table
s {$sel:tableType:Table' :: Maybe Text
tableType = Maybe Text
a} :: Table)

-- | The ID of the Data Catalog in which the table resides.
table_catalogId :: Lens.Lens' Table (Prelude.Maybe Prelude.Text)
table_catalogId :: (Maybe Text -> f (Maybe Text)) -> Table -> f Table
table_catalogId = (Table -> Maybe Text)
-> (Table -> Maybe Text -> Table)
-> Lens Table Table (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Table' {Maybe Text
catalogId :: Maybe Text
$sel:catalogId:Table' :: Table -> Maybe Text
catalogId} -> Maybe Text
catalogId) (\s :: Table
s@Table' {} Maybe Text
a -> Table
s {$sel:catalogId:Table' :: Maybe Text
catalogId = Maybe Text
a} :: Table)

-- | The owner of the table.
table_owner :: Lens.Lens' Table (Prelude.Maybe Prelude.Text)
table_owner :: (Maybe Text -> f (Maybe Text)) -> Table -> f Table
table_owner = (Table -> Maybe Text)
-> (Table -> Maybe Text -> Table)
-> Lens Table Table (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Table' {Maybe Text
owner :: Maybe Text
$sel:owner:Table' :: Table -> Maybe Text
owner} -> Maybe Text
owner) (\s :: Table
s@Table' {} Maybe Text
a -> Table
s {$sel:owner:Table' :: Maybe Text
owner = Maybe Text
a} :: Table)

-- | If the table is a view, the original text of the view; otherwise @null@.
table_viewOriginalText :: Lens.Lens' Table (Prelude.Maybe Prelude.Text)
table_viewOriginalText :: (Maybe Text -> f (Maybe Text)) -> Table -> f Table
table_viewOriginalText = (Table -> Maybe Text)
-> (Table -> Maybe Text -> Table)
-> Lens Table Table (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Table' {Maybe Text
viewOriginalText :: Maybe Text
$sel:viewOriginalText:Table' :: Table -> Maybe Text
viewOriginalText} -> Maybe Text
viewOriginalText) (\s :: Table
s@Table' {} Maybe Text
a -> Table
s {$sel:viewOriginalText:Table' :: Maybe Text
viewOriginalText = Maybe Text
a} :: Table)

-- | The last time that the table was updated.
table_updateTime :: Lens.Lens' Table (Prelude.Maybe Prelude.UTCTime)
table_updateTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Table -> f Table
table_updateTime = (Table -> Maybe POSIX)
-> (Table -> Maybe POSIX -> Table)
-> Lens Table Table (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Table' {Maybe POSIX
updateTime :: Maybe POSIX
$sel:updateTime:Table' :: Table -> Maybe POSIX
updateTime} -> Maybe POSIX
updateTime) (\s :: Table
s@Table' {} Maybe POSIX
a -> Table
s {$sel:updateTime:Table' :: Maybe POSIX
updateTime = Maybe POSIX
a} :: Table) ((Maybe POSIX -> f (Maybe POSIX)) -> Table -> f Table)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Table
-> f Table
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | If the table is a view, the expanded text of the view; otherwise @null@.
table_viewExpandedText :: Lens.Lens' Table (Prelude.Maybe Prelude.Text)
table_viewExpandedText :: (Maybe Text -> f (Maybe Text)) -> Table -> f Table
table_viewExpandedText = (Table -> Maybe Text)
-> (Table -> Maybe Text -> Table)
-> Lens Table Table (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Table' {Maybe Text
viewExpandedText :: Maybe Text
$sel:viewExpandedText:Table' :: Table -> Maybe Text
viewExpandedText} -> Maybe Text
viewExpandedText) (\s :: Table
s@Table' {} Maybe Text
a -> Table
s {$sel:viewExpandedText:Table' :: Maybe Text
viewExpandedText = Maybe Text
a} :: Table)

-- | The last time that column statistics were computed for this table.
table_lastAnalyzedTime :: Lens.Lens' Table (Prelude.Maybe Prelude.UTCTime)
table_lastAnalyzedTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Table -> f Table
table_lastAnalyzedTime = (Table -> Maybe POSIX)
-> (Table -> Maybe POSIX -> Table)
-> Lens Table Table (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Table' {Maybe POSIX
lastAnalyzedTime :: Maybe POSIX
$sel:lastAnalyzedTime:Table' :: Table -> Maybe POSIX
lastAnalyzedTime} -> Maybe POSIX
lastAnalyzedTime) (\s :: Table
s@Table' {} Maybe POSIX
a -> Table
s {$sel:lastAnalyzedTime:Table' :: Maybe POSIX
lastAnalyzedTime = Maybe POSIX
a} :: Table) ((Maybe POSIX -> f (Maybe POSIX)) -> Table -> f Table)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Table
-> f Table
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | A storage descriptor containing information about the physical storage
-- of this table.
table_storageDescriptor :: Lens.Lens' Table (Prelude.Maybe StorageDescriptor)
table_storageDescriptor :: (Maybe StorageDescriptor -> f (Maybe StorageDescriptor))
-> Table -> f Table
table_storageDescriptor = (Table -> Maybe StorageDescriptor)
-> (Table -> Maybe StorageDescriptor -> Table)
-> Lens
     Table Table (Maybe StorageDescriptor) (Maybe StorageDescriptor)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Table' {Maybe StorageDescriptor
storageDescriptor :: Maybe StorageDescriptor
$sel:storageDescriptor:Table' :: Table -> Maybe StorageDescriptor
storageDescriptor} -> Maybe StorageDescriptor
storageDescriptor) (\s :: Table
s@Table' {} Maybe StorageDescriptor
a -> Table
s {$sel:storageDescriptor:Table' :: Maybe StorageDescriptor
storageDescriptor = Maybe StorageDescriptor
a} :: Table)

-- | The name of the database where the table metadata resides. For Hive
-- compatibility, this must be all lowercase.
table_databaseName :: Lens.Lens' Table (Prelude.Maybe Prelude.Text)
table_databaseName :: (Maybe Text -> f (Maybe Text)) -> Table -> f Table
table_databaseName = (Table -> Maybe Text)
-> (Table -> Maybe Text -> Table)
-> Lens Table Table (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Table' {Maybe Text
databaseName :: Maybe Text
$sel:databaseName:Table' :: Table -> Maybe Text
databaseName} -> Maybe Text
databaseName) (\s :: Table
s@Table' {} Maybe Text
a -> Table
s {$sel:databaseName:Table' :: Maybe Text
databaseName = Maybe Text
a} :: Table)

-- | These key-value pairs define properties associated with the table.
table_parameters :: Lens.Lens' Table (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
table_parameters :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Table -> f Table
table_parameters = (Table -> Maybe (HashMap Text Text))
-> (Table -> Maybe (HashMap Text Text) -> Table)
-> Lens
     Table Table (Maybe (HashMap Text Text)) (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Table' {Maybe (HashMap Text Text)
parameters :: Maybe (HashMap Text Text)
$sel:parameters:Table' :: Table -> Maybe (HashMap Text Text)
parameters} -> Maybe (HashMap Text Text)
parameters) (\s :: Table
s@Table' {} Maybe (HashMap Text Text)
a -> Table
s {$sel:parameters:Table' :: Maybe (HashMap Text Text)
parameters = Maybe (HashMap Text Text)
a} :: Table) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> Table -> f Table)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Table
-> f Table
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The last time that the table was accessed. This is usually taken from
-- HDFS, and might not be reliable.
table_lastAccessTime :: Lens.Lens' Table (Prelude.Maybe Prelude.UTCTime)
table_lastAccessTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Table -> f Table
table_lastAccessTime = (Table -> Maybe POSIX)
-> (Table -> Maybe POSIX -> Table)
-> Lens Table Table (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Table' {Maybe POSIX
lastAccessTime :: Maybe POSIX
$sel:lastAccessTime:Table' :: Table -> Maybe POSIX
lastAccessTime} -> Maybe POSIX
lastAccessTime) (\s :: Table
s@Table' {} Maybe POSIX
a -> Table
s {$sel:lastAccessTime:Table' :: Maybe POSIX
lastAccessTime = Maybe POSIX
a} :: Table) ((Maybe POSIX -> f (Maybe POSIX)) -> Table -> f Table)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Table
-> f Table
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | A description of the table.
table_description :: Lens.Lens' Table (Prelude.Maybe Prelude.Text)
table_description :: (Maybe Text -> f (Maybe Text)) -> Table -> f Table
table_description = (Table -> Maybe Text)
-> (Table -> Maybe Text -> Table)
-> Lens Table Table (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Table' {Maybe Text
description :: Maybe Text
$sel:description:Table' :: Table -> Maybe Text
description} -> Maybe Text
description) (\s :: Table
s@Table' {} Maybe Text
a -> Table
s {$sel:description:Table' :: Maybe Text
description = Maybe Text
a} :: Table)

-- | A list of columns by which the table is partitioned. Only primitive
-- types are supported as partition keys.
--
-- When you create a table used by Amazon Athena, and you do not specify
-- any @partitionKeys@, you must at least set the value of @partitionKeys@
-- to an empty list. For example:
--
-- @\"PartitionKeys\": []@
table_partitionKeys :: Lens.Lens' Table (Prelude.Maybe [Column])
table_partitionKeys :: (Maybe [Column] -> f (Maybe [Column])) -> Table -> f Table
table_partitionKeys = (Table -> Maybe [Column])
-> (Table -> Maybe [Column] -> Table)
-> Lens Table Table (Maybe [Column]) (Maybe [Column])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Table' {Maybe [Column]
partitionKeys :: Maybe [Column]
$sel:partitionKeys:Table' :: Table -> Maybe [Column]
partitionKeys} -> Maybe [Column]
partitionKeys) (\s :: Table
s@Table' {} Maybe [Column]
a -> Table
s {$sel:partitionKeys:Table' :: Maybe [Column]
partitionKeys = Maybe [Column]
a} :: Table) ((Maybe [Column] -> f (Maybe [Column])) -> Table -> f Table)
-> ((Maybe [Column] -> f (Maybe [Column]))
    -> Maybe [Column] -> f (Maybe [Column]))
-> (Maybe [Column] -> f (Maybe [Column]))
-> Table
-> f Table
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Column] [Column] [Column] [Column]
-> Iso
     (Maybe [Column]) (Maybe [Column]) (Maybe [Column]) (Maybe [Column])
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 [Column] [Column] [Column] [Column]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The time when the table definition was created in the Data Catalog.
table_createTime :: Lens.Lens' Table (Prelude.Maybe Prelude.UTCTime)
table_createTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Table -> f Table
table_createTime = (Table -> Maybe POSIX)
-> (Table -> Maybe POSIX -> Table)
-> Lens Table Table (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Table' {Maybe POSIX
createTime :: Maybe POSIX
$sel:createTime:Table' :: Table -> Maybe POSIX
createTime} -> Maybe POSIX
createTime) (\s :: Table
s@Table' {} Maybe POSIX
a -> Table
s {$sel:createTime:Table' :: Maybe POSIX
createTime = Maybe POSIX
a} :: Table) ((Maybe POSIX -> f (Maybe POSIX)) -> Table -> f Table)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Table
-> f Table
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The table name. For Hive compatibility, this must be entirely lowercase.
table_name :: Lens.Lens' Table Prelude.Text
table_name :: (Text -> f Text) -> Table -> f Table
table_name = (Table -> Text)
-> (Table -> Text -> Table) -> Lens Table Table Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Table' {Text
name :: Text
$sel:name:Table' :: Table -> Text
name} -> Text
name) (\s :: Table
s@Table' {} Text
a -> Table
s {$sel:name:Table' :: Text
name = Text
a} :: Table)

instance Core.FromJSON Table where
  parseJSON :: Value -> Parser Table
parseJSON =
    String -> (Object -> Parser Table) -> Value -> Parser Table
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Table"
      ( \Object
x ->
          Maybe Natural
-> Maybe TableIdentifier
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe StorageDescriptor
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe POSIX
-> Maybe Text
-> Maybe [Column]
-> Maybe POSIX
-> Text
-> Table
Table'
            (Maybe Natural
 -> Maybe TableIdentifier
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe StorageDescriptor
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe [Column]
 -> Maybe POSIX
 -> Text
 -> Table)
-> Parser (Maybe Natural)
-> Parser
     (Maybe TableIdentifier
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe StorageDescriptor
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [Column]
      -> Maybe POSIX
      -> Text
      -> Table)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Retention")
            Parser
  (Maybe TableIdentifier
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe StorageDescriptor
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [Column]
   -> Maybe POSIX
   -> Text
   -> Table)
-> Parser (Maybe TableIdentifier)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe StorageDescriptor
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [Column]
      -> Maybe POSIX
      -> Text
      -> Table)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe TableIdentifier)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TargetTable")
            Parser
  (Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe StorageDescriptor
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [Column]
   -> Maybe POSIX
   -> Text
   -> Table)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe StorageDescriptor
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [Column]
      -> Maybe POSIX
      -> Text
      -> Table)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IsRegisteredWithLakeFormation")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe StorageDescriptor
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [Column]
   -> Maybe POSIX
   -> Text
   -> Table)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe StorageDescriptor
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [Column]
      -> Maybe POSIX
      -> Text
      -> Table)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreatedBy")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe StorageDescriptor
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [Column]
   -> Maybe POSIX
   -> Text
   -> Table)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe StorageDescriptor
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [Column]
      -> Maybe POSIX
      -> Text
      -> Table)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TableType")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe StorageDescriptor
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [Column]
   -> Maybe POSIX
   -> Text
   -> Table)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe StorageDescriptor
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [Column]
      -> Maybe POSIX
      -> Text
      -> Table)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CatalogId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe StorageDescriptor
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [Column]
   -> Maybe POSIX
   -> Text
   -> Table)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe StorageDescriptor
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [Column]
      -> Maybe POSIX
      -> Text
      -> Table)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Owner")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe StorageDescriptor
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [Column]
   -> Maybe POSIX
   -> Text
   -> Table)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe StorageDescriptor
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [Column]
      -> Maybe POSIX
      -> Text
      -> Table)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ViewOriginalText")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe StorageDescriptor
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [Column]
   -> Maybe POSIX
   -> Text
   -> Table)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe StorageDescriptor
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [Column]
      -> Maybe POSIX
      -> Text
      -> Table)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"UpdateTime")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe StorageDescriptor
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [Column]
   -> Maybe POSIX
   -> Text
   -> Table)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe StorageDescriptor
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [Column]
      -> Maybe POSIX
      -> Text
      -> Table)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ViewExpandedText")
            Parser
  (Maybe POSIX
   -> Maybe StorageDescriptor
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [Column]
   -> Maybe POSIX
   -> Text
   -> Table)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe StorageDescriptor
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [Column]
      -> Maybe POSIX
      -> Text
      -> Table)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LastAnalyzedTime")
            Parser
  (Maybe StorageDescriptor
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [Column]
   -> Maybe POSIX
   -> Text
   -> Table)
-> Parser (Maybe StorageDescriptor)
-> Parser
     (Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [Column]
      -> Maybe POSIX
      -> Text
      -> Table)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe StorageDescriptor)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"StorageDescriptor")
            Parser
  (Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [Column]
   -> Maybe POSIX
   -> Text
   -> Table)
-> Parser (Maybe Text)
-> Parser
     (Maybe (HashMap Text Text)
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [Column]
      -> Maybe POSIX
      -> Text
      -> Table)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DatabaseName")
            Parser
  (Maybe (HashMap Text Text)
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [Column]
   -> Maybe POSIX
   -> Text
   -> Table)
-> Parser (Maybe (HashMap Text Text))
-> Parser
     (Maybe POSIX
      -> Maybe Text -> Maybe [Column] -> Maybe POSIX -> Text -> Table)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Parameters" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe POSIX
   -> Maybe Text -> Maybe [Column] -> Maybe POSIX -> Text -> Table)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text -> Maybe [Column] -> Maybe POSIX -> Text -> Table)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LastAccessTime")
            Parser
  (Maybe Text -> Maybe [Column] -> Maybe POSIX -> Text -> Table)
-> Parser (Maybe Text)
-> Parser (Maybe [Column] -> Maybe POSIX -> Text -> Table)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Description")
            Parser (Maybe [Column] -> Maybe POSIX -> Text -> Table)
-> Parser (Maybe [Column]) -> Parser (Maybe POSIX -> Text -> Table)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Column]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PartitionKeys" Parser (Maybe (Maybe [Column]))
-> Maybe [Column] -> Parser (Maybe [Column])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Column]
forall a. Monoid a => a
Prelude.mempty)
            Parser (Maybe POSIX -> Text -> Table)
-> Parser (Maybe POSIX) -> Parser (Text -> Table)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreateTime")
            Parser (Text -> Table) -> Parser Text -> Parser Table
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Name")
      )

instance Prelude.Hashable Table

instance Prelude.NFData Table