{-# 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 #-}
module Amazonka.Glue.Types.Partition where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Glue.Types.StorageDescriptor
import qualified Amazonka.Prelude as Prelude
data Partition = Partition'
{
Partition -> Maybe Text
catalogId :: Prelude.Maybe Prelude.Text,
Partition -> Maybe POSIX
creationTime :: Prelude.Maybe Data.POSIX,
Partition -> Maybe Text
databaseName :: Prelude.Maybe Prelude.Text,
Partition -> Maybe POSIX
lastAccessTime :: Prelude.Maybe Data.POSIX,
Partition -> Maybe POSIX
lastAnalyzedTime :: Prelude.Maybe Data.POSIX,
Partition -> Maybe (HashMap Text Text)
parameters :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
Partition -> Maybe StorageDescriptor
storageDescriptor :: Prelude.Maybe StorageDescriptor,
Partition -> Maybe Text
tableName :: Prelude.Maybe Prelude.Text,
Partition -> Maybe [Text]
values :: Prelude.Maybe [Prelude.Text]
}
deriving (Partition -> Partition -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Partition -> Partition -> Bool
$c/= :: Partition -> Partition -> Bool
== :: Partition -> Partition -> Bool
$c== :: Partition -> Partition -> Bool
Prelude.Eq, ReadPrec [Partition]
ReadPrec Partition
Int -> ReadS Partition
ReadS [Partition]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Partition]
$creadListPrec :: ReadPrec [Partition]
readPrec :: ReadPrec Partition
$creadPrec :: ReadPrec Partition
readList :: ReadS [Partition]
$creadList :: ReadS [Partition]
readsPrec :: Int -> ReadS Partition
$creadsPrec :: Int -> ReadS Partition
Prelude.Read, Int -> Partition -> ShowS
[Partition] -> ShowS
Partition -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Partition] -> ShowS
$cshowList :: [Partition] -> ShowS
show :: Partition -> String
$cshow :: Partition -> String
showsPrec :: Int -> Partition -> ShowS
$cshowsPrec :: Int -> Partition -> ShowS
Prelude.Show, forall x. Rep Partition x -> Partition
forall x. Partition -> Rep Partition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Partition x -> Partition
$cfrom :: forall x. Partition -> Rep Partition x
Prelude.Generic)
newPartition ::
Partition
newPartition :: Partition
newPartition =
Partition'
{ $sel:catalogId:Partition' :: Maybe Text
catalogId = forall a. Maybe a
Prelude.Nothing,
$sel:creationTime:Partition' :: Maybe POSIX
creationTime = forall a. Maybe a
Prelude.Nothing,
$sel:databaseName:Partition' :: Maybe Text
databaseName = forall a. Maybe a
Prelude.Nothing,
$sel:lastAccessTime:Partition' :: Maybe POSIX
lastAccessTime = forall a. Maybe a
Prelude.Nothing,
$sel:lastAnalyzedTime:Partition' :: Maybe POSIX
lastAnalyzedTime = forall a. Maybe a
Prelude.Nothing,
$sel:parameters:Partition' :: Maybe (HashMap Text Text)
parameters = forall a. Maybe a
Prelude.Nothing,
$sel:storageDescriptor:Partition' :: Maybe StorageDescriptor
storageDescriptor = forall a. Maybe a
Prelude.Nothing,
$sel:tableName:Partition' :: Maybe Text
tableName = forall a. Maybe a
Prelude.Nothing,
$sel:values:Partition' :: Maybe [Text]
values = forall a. Maybe a
Prelude.Nothing
}
partition_catalogId :: Lens.Lens' Partition (Prelude.Maybe Prelude.Text)
partition_catalogId :: Lens' Partition (Maybe Text)
partition_catalogId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Partition' {Maybe Text
catalogId :: Maybe Text
$sel:catalogId:Partition' :: Partition -> Maybe Text
catalogId} -> Maybe Text
catalogId) (\s :: Partition
s@Partition' {} Maybe Text
a -> Partition
s {$sel:catalogId:Partition' :: Maybe Text
catalogId = Maybe Text
a} :: Partition)
partition_creationTime :: Lens.Lens' Partition (Prelude.Maybe Prelude.UTCTime)
partition_creationTime :: Lens' Partition (Maybe UTCTime)
partition_creationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Partition' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:Partition' :: Partition -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: Partition
s@Partition' {} Maybe POSIX
a -> Partition
s {$sel:creationTime:Partition' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: Partition) 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
partition_databaseName :: Lens.Lens' Partition (Prelude.Maybe Prelude.Text)
partition_databaseName :: Lens' Partition (Maybe Text)
partition_databaseName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Partition' {Maybe Text
databaseName :: Maybe Text
$sel:databaseName:Partition' :: Partition -> Maybe Text
databaseName} -> Maybe Text
databaseName) (\s :: Partition
s@Partition' {} Maybe Text
a -> Partition
s {$sel:databaseName:Partition' :: Maybe Text
databaseName = Maybe Text
a} :: Partition)
partition_lastAccessTime :: Lens.Lens' Partition (Prelude.Maybe Prelude.UTCTime)
partition_lastAccessTime :: Lens' Partition (Maybe UTCTime)
partition_lastAccessTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Partition' {Maybe POSIX
lastAccessTime :: Maybe POSIX
$sel:lastAccessTime:Partition' :: Partition -> Maybe POSIX
lastAccessTime} -> Maybe POSIX
lastAccessTime) (\s :: Partition
s@Partition' {} Maybe POSIX
a -> Partition
s {$sel:lastAccessTime:Partition' :: Maybe POSIX
lastAccessTime = Maybe POSIX
a} :: Partition) 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
partition_lastAnalyzedTime :: Lens.Lens' Partition (Prelude.Maybe Prelude.UTCTime)
partition_lastAnalyzedTime :: Lens' Partition (Maybe UTCTime)
partition_lastAnalyzedTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Partition' {Maybe POSIX
lastAnalyzedTime :: Maybe POSIX
$sel:lastAnalyzedTime:Partition' :: Partition -> Maybe POSIX
lastAnalyzedTime} -> Maybe POSIX
lastAnalyzedTime) (\s :: Partition
s@Partition' {} Maybe POSIX
a -> Partition
s {$sel:lastAnalyzedTime:Partition' :: Maybe POSIX
lastAnalyzedTime = Maybe POSIX
a} :: Partition) 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
partition_parameters :: Lens.Lens' Partition (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
partition_parameters :: Lens' Partition (Maybe (HashMap Text Text))
partition_parameters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Partition' {Maybe (HashMap Text Text)
parameters :: Maybe (HashMap Text Text)
$sel:parameters:Partition' :: Partition -> Maybe (HashMap Text Text)
parameters} -> Maybe (HashMap Text Text)
parameters) (\s :: Partition
s@Partition' {} Maybe (HashMap Text Text)
a -> Partition
s {$sel:parameters:Partition' :: Maybe (HashMap Text Text)
parameters = Maybe (HashMap Text Text)
a} :: Partition) 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
partition_storageDescriptor :: Lens.Lens' Partition (Prelude.Maybe StorageDescriptor)
partition_storageDescriptor :: Lens' Partition (Maybe StorageDescriptor)
partition_storageDescriptor = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Partition' {Maybe StorageDescriptor
storageDescriptor :: Maybe StorageDescriptor
$sel:storageDescriptor:Partition' :: Partition -> Maybe StorageDescriptor
storageDescriptor} -> Maybe StorageDescriptor
storageDescriptor) (\s :: Partition
s@Partition' {} Maybe StorageDescriptor
a -> Partition
s {$sel:storageDescriptor:Partition' :: Maybe StorageDescriptor
storageDescriptor = Maybe StorageDescriptor
a} :: Partition)
partition_tableName :: Lens.Lens' Partition (Prelude.Maybe Prelude.Text)
partition_tableName :: Lens' Partition (Maybe Text)
partition_tableName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Partition' {Maybe Text
tableName :: Maybe Text
$sel:tableName:Partition' :: Partition -> Maybe Text
tableName} -> Maybe Text
tableName) (\s :: Partition
s@Partition' {} Maybe Text
a -> Partition
s {$sel:tableName:Partition' :: Maybe Text
tableName = Maybe Text
a} :: Partition)
partition_values :: Lens.Lens' Partition (Prelude.Maybe [Prelude.Text])
partition_values :: Lens' Partition (Maybe [Text])
partition_values = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Partition' {Maybe [Text]
values :: Maybe [Text]
$sel:values:Partition' :: Partition -> Maybe [Text]
values} -> Maybe [Text]
values) (\s :: Partition
s@Partition' {} Maybe [Text]
a -> Partition
s {$sel:values:Partition' :: Maybe [Text]
values = Maybe [Text]
a} :: Partition) 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
instance Data.FromJSON Partition where
parseJSON :: Value -> Parser Partition
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Partition"
( \Object
x ->
Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe (HashMap Text Text)
-> Maybe StorageDescriptor
-> Maybe Text
-> Maybe [Text]
-> Partition
Partition'
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
"CatalogId")
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
"CreationTime")
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
"DatabaseName")
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
"LastAccessTime")
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
"LastAnalyzedTime")
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
"Parameters" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
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
"StorageDescriptor")
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
"TableName")
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
"Values" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable Partition where
hashWithSalt :: Int -> Partition -> Int
hashWithSalt Int
_salt Partition' {Maybe [Text]
Maybe Text
Maybe (HashMap Text Text)
Maybe POSIX
Maybe StorageDescriptor
values :: Maybe [Text]
tableName :: Maybe Text
storageDescriptor :: Maybe StorageDescriptor
parameters :: Maybe (HashMap Text Text)
lastAnalyzedTime :: Maybe POSIX
lastAccessTime :: Maybe POSIX
databaseName :: Maybe Text
creationTime :: Maybe POSIX
catalogId :: Maybe Text
$sel:values:Partition' :: Partition -> Maybe [Text]
$sel:tableName:Partition' :: Partition -> Maybe Text
$sel:storageDescriptor:Partition' :: Partition -> Maybe StorageDescriptor
$sel:parameters:Partition' :: Partition -> Maybe (HashMap Text Text)
$sel:lastAnalyzedTime:Partition' :: Partition -> Maybe POSIX
$sel:lastAccessTime:Partition' :: Partition -> Maybe POSIX
$sel:databaseName:Partition' :: Partition -> Maybe Text
$sel:creationTime:Partition' :: Partition -> Maybe POSIX
$sel:catalogId:Partition' :: Partition -> 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 POSIX
creationTime
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
databaseName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastAccessTime
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastAnalyzedTime
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
parameters
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StorageDescriptor
storageDescriptor
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
tableName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
values
instance Prelude.NFData Partition where
rnf :: Partition -> ()
rnf Partition' {Maybe [Text]
Maybe Text
Maybe (HashMap Text Text)
Maybe POSIX
Maybe StorageDescriptor
values :: Maybe [Text]
tableName :: Maybe Text
storageDescriptor :: Maybe StorageDescriptor
parameters :: Maybe (HashMap Text Text)
lastAnalyzedTime :: Maybe POSIX
lastAccessTime :: Maybe POSIX
databaseName :: Maybe Text
creationTime :: Maybe POSIX
catalogId :: Maybe Text
$sel:values:Partition' :: Partition -> Maybe [Text]
$sel:tableName:Partition' :: Partition -> Maybe Text
$sel:storageDescriptor:Partition' :: Partition -> Maybe StorageDescriptor
$sel:parameters:Partition' :: Partition -> Maybe (HashMap Text Text)
$sel:lastAnalyzedTime:Partition' :: Partition -> Maybe POSIX
$sel:lastAccessTime:Partition' :: Partition -> Maybe POSIX
$sel:databaseName:Partition' :: Partition -> Maybe Text
$sel:creationTime:Partition' :: Partition -> Maybe POSIX
$sel:catalogId:Partition' :: Partition -> 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 POSIX
creationTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
databaseName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastAccessTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastAnalyzedTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
parameters
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe StorageDescriptor
storageDescriptor
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
tableName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
values