{-# 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.StringColumnStatisticsData where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data StringColumnStatisticsData = StringColumnStatisticsData'
{
StringColumnStatisticsData -> Natural
maximumLength :: Prelude.Natural,
StringColumnStatisticsData -> Double
averageLength :: Prelude.Double,
StringColumnStatisticsData -> Natural
numberOfNulls :: Prelude.Natural,
StringColumnStatisticsData -> Natural
numberOfDistinctValues :: Prelude.Natural
}
deriving (StringColumnStatisticsData -> StringColumnStatisticsData -> Bool
(StringColumnStatisticsData -> StringColumnStatisticsData -> Bool)
-> (StringColumnStatisticsData
-> StringColumnStatisticsData -> Bool)
-> Eq StringColumnStatisticsData
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StringColumnStatisticsData -> StringColumnStatisticsData -> Bool
$c/= :: StringColumnStatisticsData -> StringColumnStatisticsData -> Bool
== :: StringColumnStatisticsData -> StringColumnStatisticsData -> Bool
$c== :: StringColumnStatisticsData -> StringColumnStatisticsData -> Bool
Prelude.Eq, ReadPrec [StringColumnStatisticsData]
ReadPrec StringColumnStatisticsData
Int -> ReadS StringColumnStatisticsData
ReadS [StringColumnStatisticsData]
(Int -> ReadS StringColumnStatisticsData)
-> ReadS [StringColumnStatisticsData]
-> ReadPrec StringColumnStatisticsData
-> ReadPrec [StringColumnStatisticsData]
-> Read StringColumnStatisticsData
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StringColumnStatisticsData]
$creadListPrec :: ReadPrec [StringColumnStatisticsData]
readPrec :: ReadPrec StringColumnStatisticsData
$creadPrec :: ReadPrec StringColumnStatisticsData
readList :: ReadS [StringColumnStatisticsData]
$creadList :: ReadS [StringColumnStatisticsData]
readsPrec :: Int -> ReadS StringColumnStatisticsData
$creadsPrec :: Int -> ReadS StringColumnStatisticsData
Prelude.Read, Int -> StringColumnStatisticsData -> ShowS
[StringColumnStatisticsData] -> ShowS
StringColumnStatisticsData -> String
(Int -> StringColumnStatisticsData -> ShowS)
-> (StringColumnStatisticsData -> String)
-> ([StringColumnStatisticsData] -> ShowS)
-> Show StringColumnStatisticsData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StringColumnStatisticsData] -> ShowS
$cshowList :: [StringColumnStatisticsData] -> ShowS
show :: StringColumnStatisticsData -> String
$cshow :: StringColumnStatisticsData -> String
showsPrec :: Int -> StringColumnStatisticsData -> ShowS
$cshowsPrec :: Int -> StringColumnStatisticsData -> ShowS
Prelude.Show, (forall x.
StringColumnStatisticsData -> Rep StringColumnStatisticsData x)
-> (forall x.
Rep StringColumnStatisticsData x -> StringColumnStatisticsData)
-> Generic StringColumnStatisticsData
forall x.
Rep StringColumnStatisticsData x -> StringColumnStatisticsData
forall x.
StringColumnStatisticsData -> Rep StringColumnStatisticsData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StringColumnStatisticsData x -> StringColumnStatisticsData
$cfrom :: forall x.
StringColumnStatisticsData -> Rep StringColumnStatisticsData x
Prelude.Generic)
newStringColumnStatisticsData ::
Prelude.Natural ->
Prelude.Double ->
Prelude.Natural ->
Prelude.Natural ->
StringColumnStatisticsData
newStringColumnStatisticsData :: Natural
-> Double -> Natural -> Natural -> StringColumnStatisticsData
newStringColumnStatisticsData
Natural
pMaximumLength_
Double
pAverageLength_
Natural
pNumberOfNulls_
Natural
pNumberOfDistinctValues_ =
StringColumnStatisticsData' :: Natural
-> Double -> Natural -> Natural -> StringColumnStatisticsData
StringColumnStatisticsData'
{ $sel:maximumLength:StringColumnStatisticsData' :: Natural
maximumLength =
Natural
pMaximumLength_,
$sel:averageLength:StringColumnStatisticsData' :: Double
averageLength = Double
pAverageLength_,
$sel:numberOfNulls:StringColumnStatisticsData' :: Natural
numberOfNulls = Natural
pNumberOfNulls_,
$sel:numberOfDistinctValues:StringColumnStatisticsData' :: Natural
numberOfDistinctValues =
Natural
pNumberOfDistinctValues_
}
stringColumnStatisticsData_maximumLength :: Lens.Lens' StringColumnStatisticsData Prelude.Natural
stringColumnStatisticsData_maximumLength :: (Natural -> f Natural)
-> StringColumnStatisticsData -> f StringColumnStatisticsData
stringColumnStatisticsData_maximumLength = (StringColumnStatisticsData -> Natural)
-> (StringColumnStatisticsData
-> Natural -> StringColumnStatisticsData)
-> Lens
StringColumnStatisticsData
StringColumnStatisticsData
Natural
Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StringColumnStatisticsData' {Natural
maximumLength :: Natural
$sel:maximumLength:StringColumnStatisticsData' :: StringColumnStatisticsData -> Natural
maximumLength} -> Natural
maximumLength) (\s :: StringColumnStatisticsData
s@StringColumnStatisticsData' {} Natural
a -> StringColumnStatisticsData
s {$sel:maximumLength:StringColumnStatisticsData' :: Natural
maximumLength = Natural
a} :: StringColumnStatisticsData)
stringColumnStatisticsData_averageLength :: Lens.Lens' StringColumnStatisticsData Prelude.Double
stringColumnStatisticsData_averageLength :: (Double -> f Double)
-> StringColumnStatisticsData -> f StringColumnStatisticsData
stringColumnStatisticsData_averageLength = (StringColumnStatisticsData -> Double)
-> (StringColumnStatisticsData
-> Double -> StringColumnStatisticsData)
-> Lens
StringColumnStatisticsData StringColumnStatisticsData Double Double
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StringColumnStatisticsData' {Double
averageLength :: Double
$sel:averageLength:StringColumnStatisticsData' :: StringColumnStatisticsData -> Double
averageLength} -> Double
averageLength) (\s :: StringColumnStatisticsData
s@StringColumnStatisticsData' {} Double
a -> StringColumnStatisticsData
s {$sel:averageLength:StringColumnStatisticsData' :: Double
averageLength = Double
a} :: StringColumnStatisticsData)
stringColumnStatisticsData_numberOfNulls :: Lens.Lens' StringColumnStatisticsData Prelude.Natural
stringColumnStatisticsData_numberOfNulls :: (Natural -> f Natural)
-> StringColumnStatisticsData -> f StringColumnStatisticsData
stringColumnStatisticsData_numberOfNulls = (StringColumnStatisticsData -> Natural)
-> (StringColumnStatisticsData
-> Natural -> StringColumnStatisticsData)
-> Lens
StringColumnStatisticsData
StringColumnStatisticsData
Natural
Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StringColumnStatisticsData' {Natural
numberOfNulls :: Natural
$sel:numberOfNulls:StringColumnStatisticsData' :: StringColumnStatisticsData -> Natural
numberOfNulls} -> Natural
numberOfNulls) (\s :: StringColumnStatisticsData
s@StringColumnStatisticsData' {} Natural
a -> StringColumnStatisticsData
s {$sel:numberOfNulls:StringColumnStatisticsData' :: Natural
numberOfNulls = Natural
a} :: StringColumnStatisticsData)
stringColumnStatisticsData_numberOfDistinctValues :: Lens.Lens' StringColumnStatisticsData Prelude.Natural
stringColumnStatisticsData_numberOfDistinctValues :: (Natural -> f Natural)
-> StringColumnStatisticsData -> f StringColumnStatisticsData
stringColumnStatisticsData_numberOfDistinctValues = (StringColumnStatisticsData -> Natural)
-> (StringColumnStatisticsData
-> Natural -> StringColumnStatisticsData)
-> Lens
StringColumnStatisticsData
StringColumnStatisticsData
Natural
Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StringColumnStatisticsData' {Natural
numberOfDistinctValues :: Natural
$sel:numberOfDistinctValues:StringColumnStatisticsData' :: StringColumnStatisticsData -> Natural
numberOfDistinctValues} -> Natural
numberOfDistinctValues) (\s :: StringColumnStatisticsData
s@StringColumnStatisticsData' {} Natural
a -> StringColumnStatisticsData
s {$sel:numberOfDistinctValues:StringColumnStatisticsData' :: Natural
numberOfDistinctValues = Natural
a} :: StringColumnStatisticsData)
instance Core.FromJSON StringColumnStatisticsData where
parseJSON :: Value -> Parser StringColumnStatisticsData
parseJSON =
String
-> (Object -> Parser StringColumnStatisticsData)
-> Value
-> Parser StringColumnStatisticsData
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"StringColumnStatisticsData"
( \Object
x ->
Natural
-> Double -> Natural -> Natural -> StringColumnStatisticsData
StringColumnStatisticsData'
(Natural
-> Double -> Natural -> Natural -> StringColumnStatisticsData)
-> Parser Natural
-> Parser
(Double -> Natural -> Natural -> StringColumnStatisticsData)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Natural
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"MaximumLength")
Parser (Double -> Natural -> Natural -> StringColumnStatisticsData)
-> Parser Double
-> Parser (Natural -> Natural -> StringColumnStatisticsData)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Double
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"AverageLength")
Parser (Natural -> Natural -> StringColumnStatisticsData)
-> Parser Natural -> Parser (Natural -> StringColumnStatisticsData)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Natural
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"NumberOfNulls")
Parser (Natural -> StringColumnStatisticsData)
-> Parser Natural -> Parser StringColumnStatisticsData
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Natural
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"NumberOfDistinctValues")
)
instance Prelude.Hashable StringColumnStatisticsData
instance Prelude.NFData StringColumnStatisticsData
instance Core.ToJSON StringColumnStatisticsData where
toJSON :: StringColumnStatisticsData -> Value
toJSON StringColumnStatisticsData' {Double
Natural
numberOfDistinctValues :: Natural
numberOfNulls :: Natural
averageLength :: Double
maximumLength :: Natural
$sel:numberOfDistinctValues:StringColumnStatisticsData' :: StringColumnStatisticsData -> Natural
$sel:numberOfNulls:StringColumnStatisticsData' :: StringColumnStatisticsData -> Natural
$sel:averageLength:StringColumnStatisticsData' :: StringColumnStatisticsData -> Double
$sel:maximumLength:StringColumnStatisticsData' :: StringColumnStatisticsData -> Natural
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"MaximumLength" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
maximumLength),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"AverageLength" Text -> Double -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Double
averageLength),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"NumberOfNulls" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
numberOfNulls),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"NumberOfDistinctValues"
Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
numberOfDistinctValues
)
]
)