{-# 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.ColumnStatistics 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.ColumnStatisticsData
import qualified Amazonka.Prelude as Prelude
data ColumnStatistics = ColumnStatistics'
{
ColumnStatistics -> Text
columnName :: Prelude.Text,
ColumnStatistics -> Text
columnType :: Prelude.Text,
ColumnStatistics -> POSIX
analyzedTime :: Data.POSIX,
ColumnStatistics -> ColumnStatisticsData
statisticsData :: ColumnStatisticsData
}
deriving (ColumnStatistics -> ColumnStatistics -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ColumnStatistics -> ColumnStatistics -> Bool
$c/= :: ColumnStatistics -> ColumnStatistics -> Bool
== :: ColumnStatistics -> ColumnStatistics -> Bool
$c== :: ColumnStatistics -> ColumnStatistics -> Bool
Prelude.Eq, ReadPrec [ColumnStatistics]
ReadPrec ColumnStatistics
Int -> ReadS ColumnStatistics
ReadS [ColumnStatistics]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ColumnStatistics]
$creadListPrec :: ReadPrec [ColumnStatistics]
readPrec :: ReadPrec ColumnStatistics
$creadPrec :: ReadPrec ColumnStatistics
readList :: ReadS [ColumnStatistics]
$creadList :: ReadS [ColumnStatistics]
readsPrec :: Int -> ReadS ColumnStatistics
$creadsPrec :: Int -> ReadS ColumnStatistics
Prelude.Read, Int -> ColumnStatistics -> ShowS
[ColumnStatistics] -> ShowS
ColumnStatistics -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ColumnStatistics] -> ShowS
$cshowList :: [ColumnStatistics] -> ShowS
show :: ColumnStatistics -> String
$cshow :: ColumnStatistics -> String
showsPrec :: Int -> ColumnStatistics -> ShowS
$cshowsPrec :: Int -> ColumnStatistics -> ShowS
Prelude.Show, forall x. Rep ColumnStatistics x -> ColumnStatistics
forall x. ColumnStatistics -> Rep ColumnStatistics x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ColumnStatistics x -> ColumnStatistics
$cfrom :: forall x. ColumnStatistics -> Rep ColumnStatistics x
Prelude.Generic)
newColumnStatistics ::
Prelude.Text ->
Prelude.Text ->
Prelude.UTCTime ->
ColumnStatisticsData ->
ColumnStatistics
newColumnStatistics :: Text -> Text -> UTCTime -> ColumnStatisticsData -> ColumnStatistics
newColumnStatistics
Text
pColumnName_
Text
pColumnType_
UTCTime
pAnalyzedTime_
ColumnStatisticsData
pStatisticsData_ =
ColumnStatistics'
{ $sel:columnName:ColumnStatistics' :: Text
columnName = Text
pColumnName_,
$sel:columnType:ColumnStatistics' :: Text
columnType = Text
pColumnType_,
$sel:analyzedTime:ColumnStatistics' :: POSIX
analyzedTime = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pAnalyzedTime_,
$sel:statisticsData:ColumnStatistics' :: ColumnStatisticsData
statisticsData = ColumnStatisticsData
pStatisticsData_
}
columnStatistics_columnName :: Lens.Lens' ColumnStatistics Prelude.Text
columnStatistics_columnName :: Lens' ColumnStatistics Text
columnStatistics_columnName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnStatistics' {Text
columnName :: Text
$sel:columnName:ColumnStatistics' :: ColumnStatistics -> Text
columnName} -> Text
columnName) (\s :: ColumnStatistics
s@ColumnStatistics' {} Text
a -> ColumnStatistics
s {$sel:columnName:ColumnStatistics' :: Text
columnName = Text
a} :: ColumnStatistics)
columnStatistics_columnType :: Lens.Lens' ColumnStatistics Prelude.Text
columnStatistics_columnType :: Lens' ColumnStatistics Text
columnStatistics_columnType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnStatistics' {Text
columnType :: Text
$sel:columnType:ColumnStatistics' :: ColumnStatistics -> Text
columnType} -> Text
columnType) (\s :: ColumnStatistics
s@ColumnStatistics' {} Text
a -> ColumnStatistics
s {$sel:columnType:ColumnStatistics' :: Text
columnType = Text
a} :: ColumnStatistics)
columnStatistics_analyzedTime :: Lens.Lens' ColumnStatistics Prelude.UTCTime
columnStatistics_analyzedTime :: Lens' ColumnStatistics UTCTime
columnStatistics_analyzedTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnStatistics' {POSIX
analyzedTime :: POSIX
$sel:analyzedTime:ColumnStatistics' :: ColumnStatistics -> POSIX
analyzedTime} -> POSIX
analyzedTime) (\s :: ColumnStatistics
s@ColumnStatistics' {} POSIX
a -> ColumnStatistics
s {$sel:analyzedTime:ColumnStatistics' :: POSIX
analyzedTime = POSIX
a} :: ColumnStatistics) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
columnStatistics_statisticsData :: Lens.Lens' ColumnStatistics ColumnStatisticsData
columnStatistics_statisticsData :: Lens' ColumnStatistics ColumnStatisticsData
columnStatistics_statisticsData = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnStatistics' {ColumnStatisticsData
statisticsData :: ColumnStatisticsData
$sel:statisticsData:ColumnStatistics' :: ColumnStatistics -> ColumnStatisticsData
statisticsData} -> ColumnStatisticsData
statisticsData) (\s :: ColumnStatistics
s@ColumnStatistics' {} ColumnStatisticsData
a -> ColumnStatistics
s {$sel:statisticsData:ColumnStatistics' :: ColumnStatisticsData
statisticsData = ColumnStatisticsData
a} :: ColumnStatistics)
instance Data.FromJSON ColumnStatistics where
parseJSON :: Value -> Parser ColumnStatistics
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ColumnStatistics"
( \Object
x ->
Text -> Text -> POSIX -> ColumnStatisticsData -> ColumnStatistics
ColumnStatistics'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ColumnName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ColumnType")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"AnalyzedTime")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"StatisticsData")
)
instance Prelude.Hashable ColumnStatistics where
hashWithSalt :: Int -> ColumnStatistics -> Int
hashWithSalt Int
_salt ColumnStatistics' {Text
POSIX
ColumnStatisticsData
statisticsData :: ColumnStatisticsData
analyzedTime :: POSIX
columnType :: Text
columnName :: Text
$sel:statisticsData:ColumnStatistics' :: ColumnStatistics -> ColumnStatisticsData
$sel:analyzedTime:ColumnStatistics' :: ColumnStatistics -> POSIX
$sel:columnType:ColumnStatistics' :: ColumnStatistics -> Text
$sel:columnName:ColumnStatistics' :: ColumnStatistics -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
columnName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
columnType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
analyzedTime
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ColumnStatisticsData
statisticsData
instance Prelude.NFData ColumnStatistics where
rnf :: ColumnStatistics -> ()
rnf ColumnStatistics' {Text
POSIX
ColumnStatisticsData
statisticsData :: ColumnStatisticsData
analyzedTime :: POSIX
columnType :: Text
columnName :: Text
$sel:statisticsData:ColumnStatistics' :: ColumnStatistics -> ColumnStatisticsData
$sel:analyzedTime:ColumnStatistics' :: ColumnStatistics -> POSIX
$sel:columnType:ColumnStatistics' :: ColumnStatistics -> Text
$sel:columnName:ColumnStatistics' :: ColumnStatistics -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
columnName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
columnType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
analyzedTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ColumnStatisticsData
statisticsData
instance Data.ToJSON ColumnStatistics where
toJSON :: ColumnStatistics -> Value
toJSON ColumnStatistics' {Text
POSIX
ColumnStatisticsData
statisticsData :: ColumnStatisticsData
analyzedTime :: POSIX
columnType :: Text
columnName :: Text
$sel:statisticsData:ColumnStatistics' :: ColumnStatistics -> ColumnStatisticsData
$sel:analyzedTime:ColumnStatistics' :: ColumnStatistics -> POSIX
$sel:columnType:ColumnStatistics' :: ColumnStatistics -> Text
$sel:columnName:ColumnStatistics' :: ColumnStatistics -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"ColumnName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
columnName),
forall a. a -> Maybe a
Prelude.Just (Key
"ColumnType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
columnType),
forall a. a -> Maybe a
Prelude.Just (Key
"AnalyzedTime" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= POSIX
analyzedTime),
forall a. a -> Maybe a
Prelude.Just
(Key
"StatisticsData" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ColumnStatisticsData
statisticsData)
]
)