{-# 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.BinaryColumnStatisticsData where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data BinaryColumnStatisticsData = BinaryColumnStatisticsData'
{
BinaryColumnStatisticsData -> Natural
maximumLength :: Prelude.Natural,
BinaryColumnStatisticsData -> Double
averageLength :: Prelude.Double,
BinaryColumnStatisticsData -> Natural
numberOfNulls :: Prelude.Natural
}
deriving (BinaryColumnStatisticsData -> BinaryColumnStatisticsData -> Bool
(BinaryColumnStatisticsData -> BinaryColumnStatisticsData -> Bool)
-> (BinaryColumnStatisticsData
-> BinaryColumnStatisticsData -> Bool)
-> Eq BinaryColumnStatisticsData
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BinaryColumnStatisticsData -> BinaryColumnStatisticsData -> Bool
$c/= :: BinaryColumnStatisticsData -> BinaryColumnStatisticsData -> Bool
== :: BinaryColumnStatisticsData -> BinaryColumnStatisticsData -> Bool
$c== :: BinaryColumnStatisticsData -> BinaryColumnStatisticsData -> Bool
Prelude.Eq, ReadPrec [BinaryColumnStatisticsData]
ReadPrec BinaryColumnStatisticsData
Int -> ReadS BinaryColumnStatisticsData
ReadS [BinaryColumnStatisticsData]
(Int -> ReadS BinaryColumnStatisticsData)
-> ReadS [BinaryColumnStatisticsData]
-> ReadPrec BinaryColumnStatisticsData
-> ReadPrec [BinaryColumnStatisticsData]
-> Read BinaryColumnStatisticsData
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BinaryColumnStatisticsData]
$creadListPrec :: ReadPrec [BinaryColumnStatisticsData]
readPrec :: ReadPrec BinaryColumnStatisticsData
$creadPrec :: ReadPrec BinaryColumnStatisticsData
readList :: ReadS [BinaryColumnStatisticsData]
$creadList :: ReadS [BinaryColumnStatisticsData]
readsPrec :: Int -> ReadS BinaryColumnStatisticsData
$creadsPrec :: Int -> ReadS BinaryColumnStatisticsData
Prelude.Read, Int -> BinaryColumnStatisticsData -> ShowS
[BinaryColumnStatisticsData] -> ShowS
BinaryColumnStatisticsData -> String
(Int -> BinaryColumnStatisticsData -> ShowS)
-> (BinaryColumnStatisticsData -> String)
-> ([BinaryColumnStatisticsData] -> ShowS)
-> Show BinaryColumnStatisticsData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BinaryColumnStatisticsData] -> ShowS
$cshowList :: [BinaryColumnStatisticsData] -> ShowS
show :: BinaryColumnStatisticsData -> String
$cshow :: BinaryColumnStatisticsData -> String
showsPrec :: Int -> BinaryColumnStatisticsData -> ShowS
$cshowsPrec :: Int -> BinaryColumnStatisticsData -> ShowS
Prelude.Show, (forall x.
BinaryColumnStatisticsData -> Rep BinaryColumnStatisticsData x)
-> (forall x.
Rep BinaryColumnStatisticsData x -> BinaryColumnStatisticsData)
-> Generic BinaryColumnStatisticsData
forall x.
Rep BinaryColumnStatisticsData x -> BinaryColumnStatisticsData
forall x.
BinaryColumnStatisticsData -> Rep BinaryColumnStatisticsData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BinaryColumnStatisticsData x -> BinaryColumnStatisticsData
$cfrom :: forall x.
BinaryColumnStatisticsData -> Rep BinaryColumnStatisticsData x
Prelude.Generic)
newBinaryColumnStatisticsData ::
Prelude.Natural ->
Prelude.Double ->
Prelude.Natural ->
BinaryColumnStatisticsData
newBinaryColumnStatisticsData :: Natural -> Double -> Natural -> BinaryColumnStatisticsData
newBinaryColumnStatisticsData
Natural
pMaximumLength_
Double
pAverageLength_
Natural
pNumberOfNulls_ =
BinaryColumnStatisticsData' :: Natural -> Double -> Natural -> BinaryColumnStatisticsData
BinaryColumnStatisticsData'
{ $sel:maximumLength:BinaryColumnStatisticsData' :: Natural
maximumLength =
Natural
pMaximumLength_,
$sel:averageLength:BinaryColumnStatisticsData' :: Double
averageLength = Double
pAverageLength_,
$sel:numberOfNulls:BinaryColumnStatisticsData' :: Natural
numberOfNulls = Natural
pNumberOfNulls_
}
binaryColumnStatisticsData_maximumLength :: Lens.Lens' BinaryColumnStatisticsData Prelude.Natural
binaryColumnStatisticsData_maximumLength :: (Natural -> f Natural)
-> BinaryColumnStatisticsData -> f BinaryColumnStatisticsData
binaryColumnStatisticsData_maximumLength = (BinaryColumnStatisticsData -> Natural)
-> (BinaryColumnStatisticsData
-> Natural -> BinaryColumnStatisticsData)
-> Lens
BinaryColumnStatisticsData
BinaryColumnStatisticsData
Natural
Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BinaryColumnStatisticsData' {Natural
maximumLength :: Natural
$sel:maximumLength:BinaryColumnStatisticsData' :: BinaryColumnStatisticsData -> Natural
maximumLength} -> Natural
maximumLength) (\s :: BinaryColumnStatisticsData
s@BinaryColumnStatisticsData' {} Natural
a -> BinaryColumnStatisticsData
s {$sel:maximumLength:BinaryColumnStatisticsData' :: Natural
maximumLength = Natural
a} :: BinaryColumnStatisticsData)
binaryColumnStatisticsData_averageLength :: Lens.Lens' BinaryColumnStatisticsData Prelude.Double
binaryColumnStatisticsData_averageLength :: (Double -> f Double)
-> BinaryColumnStatisticsData -> f BinaryColumnStatisticsData
binaryColumnStatisticsData_averageLength = (BinaryColumnStatisticsData -> Double)
-> (BinaryColumnStatisticsData
-> Double -> BinaryColumnStatisticsData)
-> Lens
BinaryColumnStatisticsData BinaryColumnStatisticsData Double Double
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BinaryColumnStatisticsData' {Double
averageLength :: Double
$sel:averageLength:BinaryColumnStatisticsData' :: BinaryColumnStatisticsData -> Double
averageLength} -> Double
averageLength) (\s :: BinaryColumnStatisticsData
s@BinaryColumnStatisticsData' {} Double
a -> BinaryColumnStatisticsData
s {$sel:averageLength:BinaryColumnStatisticsData' :: Double
averageLength = Double
a} :: BinaryColumnStatisticsData)
binaryColumnStatisticsData_numberOfNulls :: Lens.Lens' BinaryColumnStatisticsData Prelude.Natural
binaryColumnStatisticsData_numberOfNulls :: (Natural -> f Natural)
-> BinaryColumnStatisticsData -> f BinaryColumnStatisticsData
binaryColumnStatisticsData_numberOfNulls = (BinaryColumnStatisticsData -> Natural)
-> (BinaryColumnStatisticsData
-> Natural -> BinaryColumnStatisticsData)
-> Lens
BinaryColumnStatisticsData
BinaryColumnStatisticsData
Natural
Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BinaryColumnStatisticsData' {Natural
numberOfNulls :: Natural
$sel:numberOfNulls:BinaryColumnStatisticsData' :: BinaryColumnStatisticsData -> Natural
numberOfNulls} -> Natural
numberOfNulls) (\s :: BinaryColumnStatisticsData
s@BinaryColumnStatisticsData' {} Natural
a -> BinaryColumnStatisticsData
s {$sel:numberOfNulls:BinaryColumnStatisticsData' :: Natural
numberOfNulls = Natural
a} :: BinaryColumnStatisticsData)
instance Core.FromJSON BinaryColumnStatisticsData where
parseJSON :: Value -> Parser BinaryColumnStatisticsData
parseJSON =
String
-> (Object -> Parser BinaryColumnStatisticsData)
-> Value
-> Parser BinaryColumnStatisticsData
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"BinaryColumnStatisticsData"
( \Object
x ->
Natural -> Double -> Natural -> BinaryColumnStatisticsData
BinaryColumnStatisticsData'
(Natural -> Double -> Natural -> BinaryColumnStatisticsData)
-> Parser Natural
-> Parser (Double -> Natural -> BinaryColumnStatisticsData)
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 -> BinaryColumnStatisticsData)
-> Parser Double -> Parser (Natural -> BinaryColumnStatisticsData)
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 -> BinaryColumnStatisticsData)
-> Parser Natural -> Parser BinaryColumnStatisticsData
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")
)
instance Prelude.Hashable BinaryColumnStatisticsData
instance Prelude.NFData BinaryColumnStatisticsData
instance Core.ToJSON BinaryColumnStatisticsData where
toJSON :: BinaryColumnStatisticsData -> Value
toJSON BinaryColumnStatisticsData' {Double
Natural
numberOfNulls :: Natural
averageLength :: Double
maximumLength :: Natural
$sel:numberOfNulls:BinaryColumnStatisticsData' :: BinaryColumnStatisticsData -> Natural
$sel:averageLength:BinaryColumnStatisticsData' :: BinaryColumnStatisticsData -> Double
$sel:maximumLength:BinaryColumnStatisticsData' :: BinaryColumnStatisticsData -> 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)
]
)