{-# 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.LakeFormation.Types.TableObject
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.LakeFormation.Types.TableObject where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | Specifies the details of a governed table.
--
-- /See:/ 'newTableObject' smart constructor.
data TableObject = TableObject'
  { -- | The Amazon S3 ETag of the object. Returned by @GetTableObjects@ for
    -- validation and used to identify changes to the underlying data.
    TableObject -> Maybe Text
eTag :: Prelude.Maybe Prelude.Text,
    -- | The size of the Amazon S3 object in bytes.
    TableObject -> Maybe Integer
size :: Prelude.Maybe Prelude.Integer,
    -- | The Amazon S3 location of the object.
    TableObject -> Maybe Text
uri :: Prelude.Maybe Prelude.Text
  }
  deriving (TableObject -> TableObject -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TableObject -> TableObject -> Bool
$c/= :: TableObject -> TableObject -> Bool
== :: TableObject -> TableObject -> Bool
$c== :: TableObject -> TableObject -> Bool
Prelude.Eq, ReadPrec [TableObject]
ReadPrec TableObject
Int -> ReadS TableObject
ReadS [TableObject]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TableObject]
$creadListPrec :: ReadPrec [TableObject]
readPrec :: ReadPrec TableObject
$creadPrec :: ReadPrec TableObject
readList :: ReadS [TableObject]
$creadList :: ReadS [TableObject]
readsPrec :: Int -> ReadS TableObject
$creadsPrec :: Int -> ReadS TableObject
Prelude.Read, Int -> TableObject -> ShowS
[TableObject] -> ShowS
TableObject -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TableObject] -> ShowS
$cshowList :: [TableObject] -> ShowS
show :: TableObject -> String
$cshow :: TableObject -> String
showsPrec :: Int -> TableObject -> ShowS
$cshowsPrec :: Int -> TableObject -> ShowS
Prelude.Show, forall x. Rep TableObject x -> TableObject
forall x. TableObject -> Rep TableObject x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TableObject x -> TableObject
$cfrom :: forall x. TableObject -> Rep TableObject x
Prelude.Generic)

-- |
-- Create a value of 'TableObject' 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:
--
-- 'eTag', 'tableObject_eTag' - The Amazon S3 ETag of the object. Returned by @GetTableObjects@ for
-- validation and used to identify changes to the underlying data.
--
-- 'size', 'tableObject_size' - The size of the Amazon S3 object in bytes.
--
-- 'uri', 'tableObject_uri' - The Amazon S3 location of the object.
newTableObject ::
  TableObject
newTableObject :: TableObject
newTableObject =
  TableObject'
    { $sel:eTag:TableObject' :: Maybe Text
eTag = forall a. Maybe a
Prelude.Nothing,
      $sel:size:TableObject' :: Maybe Integer
size = forall a. Maybe a
Prelude.Nothing,
      $sel:uri:TableObject' :: Maybe Text
uri = forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon S3 ETag of the object. Returned by @GetTableObjects@ for
-- validation and used to identify changes to the underlying data.
tableObject_eTag :: Lens.Lens' TableObject (Prelude.Maybe Prelude.Text)
tableObject_eTag :: Lens' TableObject (Maybe Text)
tableObject_eTag = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TableObject' {Maybe Text
eTag :: Maybe Text
$sel:eTag:TableObject' :: TableObject -> Maybe Text
eTag} -> Maybe Text
eTag) (\s :: TableObject
s@TableObject' {} Maybe Text
a -> TableObject
s {$sel:eTag:TableObject' :: Maybe Text
eTag = Maybe Text
a} :: TableObject)

-- | The size of the Amazon S3 object in bytes.
tableObject_size :: Lens.Lens' TableObject (Prelude.Maybe Prelude.Integer)
tableObject_size :: Lens' TableObject (Maybe Integer)
tableObject_size = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TableObject' {Maybe Integer
size :: Maybe Integer
$sel:size:TableObject' :: TableObject -> Maybe Integer
size} -> Maybe Integer
size) (\s :: TableObject
s@TableObject' {} Maybe Integer
a -> TableObject
s {$sel:size:TableObject' :: Maybe Integer
size = Maybe Integer
a} :: TableObject)

-- | The Amazon S3 location of the object.
tableObject_uri :: Lens.Lens' TableObject (Prelude.Maybe Prelude.Text)
tableObject_uri :: Lens' TableObject (Maybe Text)
tableObject_uri = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TableObject' {Maybe Text
uri :: Maybe Text
$sel:uri:TableObject' :: TableObject -> Maybe Text
uri} -> Maybe Text
uri) (\s :: TableObject
s@TableObject' {} Maybe Text
a -> TableObject
s {$sel:uri:TableObject' :: Maybe Text
uri = Maybe Text
a} :: TableObject)

instance Data.FromJSON TableObject where
  parseJSON :: Value -> Parser TableObject
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"TableObject"
      ( \Object
x ->
          Maybe Text -> Maybe Integer -> Maybe Text -> TableObject
TableObject'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ETag")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Size")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Uri")
      )

instance Prelude.Hashable TableObject where
  hashWithSalt :: Int -> TableObject -> Int
hashWithSalt Int
_salt TableObject' {Maybe Integer
Maybe Text
uri :: Maybe Text
size :: Maybe Integer
eTag :: Maybe Text
$sel:uri:TableObject' :: TableObject -> Maybe Text
$sel:size:TableObject' :: TableObject -> Maybe Integer
$sel:eTag:TableObject' :: TableObject -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
eTag
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
size
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
uri

instance Prelude.NFData TableObject where
  rnf :: TableObject -> ()
rnf TableObject' {Maybe Integer
Maybe Text
uri :: Maybe Text
size :: Maybe Integer
eTag :: Maybe Text
$sel:uri:TableObject' :: TableObject -> Maybe Text
$sel:size:TableObject' :: TableObject -> Maybe Integer
$sel:eTag:TableObject' :: TableObject -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
eTag
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
size
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
uri