{-# 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.Glue.Types.ColumnStatisticsData
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Glue.Types.ColumnStatisticsData where

import qualified Amazonka.Core as Core
import Amazonka.Glue.Types.BinaryColumnStatisticsData
import Amazonka.Glue.Types.BooleanColumnStatisticsData
import Amazonka.Glue.Types.ColumnStatisticsType
import Amazonka.Glue.Types.DateColumnStatisticsData
import Amazonka.Glue.Types.DecimalColumnStatisticsData
import Amazonka.Glue.Types.DoubleColumnStatisticsData
import Amazonka.Glue.Types.LongColumnStatisticsData
import Amazonka.Glue.Types.StringColumnStatisticsData
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Contains the individual types of column statistics data. Only one data
-- object should be set and indicated by the @Type@ attribute.
--
-- /See:/ 'newColumnStatisticsData' smart constructor.
data ColumnStatisticsData = ColumnStatisticsData'
  { -- | Binary column statistics data.
    ColumnStatisticsData -> Maybe BinaryColumnStatisticsData
binaryColumnStatisticsData :: Prelude.Maybe BinaryColumnStatisticsData,
    -- | Date column statistics data.
    ColumnStatisticsData -> Maybe DateColumnStatisticsData
dateColumnStatisticsData :: Prelude.Maybe DateColumnStatisticsData,
    -- | Boolean column statistics data.
    ColumnStatisticsData -> Maybe BooleanColumnStatisticsData
booleanColumnStatisticsData :: Prelude.Maybe BooleanColumnStatisticsData,
    -- | Decimal column statistics data.
    ColumnStatisticsData -> Maybe DecimalColumnStatisticsData
decimalColumnStatisticsData :: Prelude.Maybe DecimalColumnStatisticsData,
    -- | Double column statistics data.
    ColumnStatisticsData -> Maybe DoubleColumnStatisticsData
doubleColumnStatisticsData :: Prelude.Maybe DoubleColumnStatisticsData,
    -- | String column statistics data.
    ColumnStatisticsData -> Maybe StringColumnStatisticsData
stringColumnStatisticsData :: Prelude.Maybe StringColumnStatisticsData,
    -- | Long column statistics data.
    ColumnStatisticsData -> Maybe LongColumnStatisticsData
longColumnStatisticsData :: Prelude.Maybe LongColumnStatisticsData,
    -- | The type of column statistics data.
    ColumnStatisticsData -> ColumnStatisticsType
type' :: ColumnStatisticsType
  }
  deriving (ColumnStatisticsData -> ColumnStatisticsData -> Bool
(ColumnStatisticsData -> ColumnStatisticsData -> Bool)
-> (ColumnStatisticsData -> ColumnStatisticsData -> Bool)
-> Eq ColumnStatisticsData
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ColumnStatisticsData -> ColumnStatisticsData -> Bool
$c/= :: ColumnStatisticsData -> ColumnStatisticsData -> Bool
== :: ColumnStatisticsData -> ColumnStatisticsData -> Bool
$c== :: ColumnStatisticsData -> ColumnStatisticsData -> Bool
Prelude.Eq, ReadPrec [ColumnStatisticsData]
ReadPrec ColumnStatisticsData
Int -> ReadS ColumnStatisticsData
ReadS [ColumnStatisticsData]
(Int -> ReadS ColumnStatisticsData)
-> ReadS [ColumnStatisticsData]
-> ReadPrec ColumnStatisticsData
-> ReadPrec [ColumnStatisticsData]
-> Read ColumnStatisticsData
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ColumnStatisticsData]
$creadListPrec :: ReadPrec [ColumnStatisticsData]
readPrec :: ReadPrec ColumnStatisticsData
$creadPrec :: ReadPrec ColumnStatisticsData
readList :: ReadS [ColumnStatisticsData]
$creadList :: ReadS [ColumnStatisticsData]
readsPrec :: Int -> ReadS ColumnStatisticsData
$creadsPrec :: Int -> ReadS ColumnStatisticsData
Prelude.Read, Int -> ColumnStatisticsData -> ShowS
[ColumnStatisticsData] -> ShowS
ColumnStatisticsData -> String
(Int -> ColumnStatisticsData -> ShowS)
-> (ColumnStatisticsData -> String)
-> ([ColumnStatisticsData] -> ShowS)
-> Show ColumnStatisticsData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ColumnStatisticsData] -> ShowS
$cshowList :: [ColumnStatisticsData] -> ShowS
show :: ColumnStatisticsData -> String
$cshow :: ColumnStatisticsData -> String
showsPrec :: Int -> ColumnStatisticsData -> ShowS
$cshowsPrec :: Int -> ColumnStatisticsData -> ShowS
Prelude.Show, (forall x. ColumnStatisticsData -> Rep ColumnStatisticsData x)
-> (forall x. Rep ColumnStatisticsData x -> ColumnStatisticsData)
-> Generic ColumnStatisticsData
forall x. Rep ColumnStatisticsData x -> ColumnStatisticsData
forall x. ColumnStatisticsData -> Rep ColumnStatisticsData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ColumnStatisticsData x -> ColumnStatisticsData
$cfrom :: forall x. ColumnStatisticsData -> Rep ColumnStatisticsData x
Prelude.Generic)

-- |
-- Create a value of 'ColumnStatisticsData' 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:
--
-- 'binaryColumnStatisticsData', 'columnStatisticsData_binaryColumnStatisticsData' - Binary column statistics data.
--
-- 'dateColumnStatisticsData', 'columnStatisticsData_dateColumnStatisticsData' - Date column statistics data.
--
-- 'booleanColumnStatisticsData', 'columnStatisticsData_booleanColumnStatisticsData' - Boolean column statistics data.
--
-- 'decimalColumnStatisticsData', 'columnStatisticsData_decimalColumnStatisticsData' - Decimal column statistics data.
--
-- 'doubleColumnStatisticsData', 'columnStatisticsData_doubleColumnStatisticsData' - Double column statistics data.
--
-- 'stringColumnStatisticsData', 'columnStatisticsData_stringColumnStatisticsData' - String column statistics data.
--
-- 'longColumnStatisticsData', 'columnStatisticsData_longColumnStatisticsData' - Long column statistics data.
--
-- 'type'', 'columnStatisticsData_type' - The type of column statistics data.
newColumnStatisticsData ::
  -- | 'type''
  ColumnStatisticsType ->
  ColumnStatisticsData
newColumnStatisticsData :: ColumnStatisticsType -> ColumnStatisticsData
newColumnStatisticsData ColumnStatisticsType
pType_ =
  ColumnStatisticsData' :: Maybe BinaryColumnStatisticsData
-> Maybe DateColumnStatisticsData
-> Maybe BooleanColumnStatisticsData
-> Maybe DecimalColumnStatisticsData
-> Maybe DoubleColumnStatisticsData
-> Maybe StringColumnStatisticsData
-> Maybe LongColumnStatisticsData
-> ColumnStatisticsType
-> ColumnStatisticsData
ColumnStatisticsData'
    { $sel:binaryColumnStatisticsData:ColumnStatisticsData' :: Maybe BinaryColumnStatisticsData
binaryColumnStatisticsData =
        Maybe BinaryColumnStatisticsData
forall a. Maybe a
Prelude.Nothing,
      $sel:dateColumnStatisticsData:ColumnStatisticsData' :: Maybe DateColumnStatisticsData
dateColumnStatisticsData = Maybe DateColumnStatisticsData
forall a. Maybe a
Prelude.Nothing,
      $sel:booleanColumnStatisticsData:ColumnStatisticsData' :: Maybe BooleanColumnStatisticsData
booleanColumnStatisticsData = Maybe BooleanColumnStatisticsData
forall a. Maybe a
Prelude.Nothing,
      $sel:decimalColumnStatisticsData:ColumnStatisticsData' :: Maybe DecimalColumnStatisticsData
decimalColumnStatisticsData = Maybe DecimalColumnStatisticsData
forall a. Maybe a
Prelude.Nothing,
      $sel:doubleColumnStatisticsData:ColumnStatisticsData' :: Maybe DoubleColumnStatisticsData
doubleColumnStatisticsData = Maybe DoubleColumnStatisticsData
forall a. Maybe a
Prelude.Nothing,
      $sel:stringColumnStatisticsData:ColumnStatisticsData' :: Maybe StringColumnStatisticsData
stringColumnStatisticsData = Maybe StringColumnStatisticsData
forall a. Maybe a
Prelude.Nothing,
      $sel:longColumnStatisticsData:ColumnStatisticsData' :: Maybe LongColumnStatisticsData
longColumnStatisticsData = Maybe LongColumnStatisticsData
forall a. Maybe a
Prelude.Nothing,
      $sel:type':ColumnStatisticsData' :: ColumnStatisticsType
type' = ColumnStatisticsType
pType_
    }

-- | Binary column statistics data.
columnStatisticsData_binaryColumnStatisticsData :: Lens.Lens' ColumnStatisticsData (Prelude.Maybe BinaryColumnStatisticsData)
columnStatisticsData_binaryColumnStatisticsData :: (Maybe BinaryColumnStatisticsData
 -> f (Maybe BinaryColumnStatisticsData))
-> ColumnStatisticsData -> f ColumnStatisticsData
columnStatisticsData_binaryColumnStatisticsData = (ColumnStatisticsData -> Maybe BinaryColumnStatisticsData)
-> (ColumnStatisticsData
    -> Maybe BinaryColumnStatisticsData -> ColumnStatisticsData)
-> Lens
     ColumnStatisticsData
     ColumnStatisticsData
     (Maybe BinaryColumnStatisticsData)
     (Maybe BinaryColumnStatisticsData)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnStatisticsData' {Maybe BinaryColumnStatisticsData
binaryColumnStatisticsData :: Maybe BinaryColumnStatisticsData
$sel:binaryColumnStatisticsData:ColumnStatisticsData' :: ColumnStatisticsData -> Maybe BinaryColumnStatisticsData
binaryColumnStatisticsData} -> Maybe BinaryColumnStatisticsData
binaryColumnStatisticsData) (\s :: ColumnStatisticsData
s@ColumnStatisticsData' {} Maybe BinaryColumnStatisticsData
a -> ColumnStatisticsData
s {$sel:binaryColumnStatisticsData:ColumnStatisticsData' :: Maybe BinaryColumnStatisticsData
binaryColumnStatisticsData = Maybe BinaryColumnStatisticsData
a} :: ColumnStatisticsData)

-- | Date column statistics data.
columnStatisticsData_dateColumnStatisticsData :: Lens.Lens' ColumnStatisticsData (Prelude.Maybe DateColumnStatisticsData)
columnStatisticsData_dateColumnStatisticsData :: (Maybe DateColumnStatisticsData
 -> f (Maybe DateColumnStatisticsData))
-> ColumnStatisticsData -> f ColumnStatisticsData
columnStatisticsData_dateColumnStatisticsData = (ColumnStatisticsData -> Maybe DateColumnStatisticsData)
-> (ColumnStatisticsData
    -> Maybe DateColumnStatisticsData -> ColumnStatisticsData)
-> Lens
     ColumnStatisticsData
     ColumnStatisticsData
     (Maybe DateColumnStatisticsData)
     (Maybe DateColumnStatisticsData)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnStatisticsData' {Maybe DateColumnStatisticsData
dateColumnStatisticsData :: Maybe DateColumnStatisticsData
$sel:dateColumnStatisticsData:ColumnStatisticsData' :: ColumnStatisticsData -> Maybe DateColumnStatisticsData
dateColumnStatisticsData} -> Maybe DateColumnStatisticsData
dateColumnStatisticsData) (\s :: ColumnStatisticsData
s@ColumnStatisticsData' {} Maybe DateColumnStatisticsData
a -> ColumnStatisticsData
s {$sel:dateColumnStatisticsData:ColumnStatisticsData' :: Maybe DateColumnStatisticsData
dateColumnStatisticsData = Maybe DateColumnStatisticsData
a} :: ColumnStatisticsData)

-- | Boolean column statistics data.
columnStatisticsData_booleanColumnStatisticsData :: Lens.Lens' ColumnStatisticsData (Prelude.Maybe BooleanColumnStatisticsData)
columnStatisticsData_booleanColumnStatisticsData :: (Maybe BooleanColumnStatisticsData
 -> f (Maybe BooleanColumnStatisticsData))
-> ColumnStatisticsData -> f ColumnStatisticsData
columnStatisticsData_booleanColumnStatisticsData = (ColumnStatisticsData -> Maybe BooleanColumnStatisticsData)
-> (ColumnStatisticsData
    -> Maybe BooleanColumnStatisticsData -> ColumnStatisticsData)
-> Lens
     ColumnStatisticsData
     ColumnStatisticsData
     (Maybe BooleanColumnStatisticsData)
     (Maybe BooleanColumnStatisticsData)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnStatisticsData' {Maybe BooleanColumnStatisticsData
booleanColumnStatisticsData :: Maybe BooleanColumnStatisticsData
$sel:booleanColumnStatisticsData:ColumnStatisticsData' :: ColumnStatisticsData -> Maybe BooleanColumnStatisticsData
booleanColumnStatisticsData} -> Maybe BooleanColumnStatisticsData
booleanColumnStatisticsData) (\s :: ColumnStatisticsData
s@ColumnStatisticsData' {} Maybe BooleanColumnStatisticsData
a -> ColumnStatisticsData
s {$sel:booleanColumnStatisticsData:ColumnStatisticsData' :: Maybe BooleanColumnStatisticsData
booleanColumnStatisticsData = Maybe BooleanColumnStatisticsData
a} :: ColumnStatisticsData)

-- | Decimal column statistics data.
columnStatisticsData_decimalColumnStatisticsData :: Lens.Lens' ColumnStatisticsData (Prelude.Maybe DecimalColumnStatisticsData)
columnStatisticsData_decimalColumnStatisticsData :: (Maybe DecimalColumnStatisticsData
 -> f (Maybe DecimalColumnStatisticsData))
-> ColumnStatisticsData -> f ColumnStatisticsData
columnStatisticsData_decimalColumnStatisticsData = (ColumnStatisticsData -> Maybe DecimalColumnStatisticsData)
-> (ColumnStatisticsData
    -> Maybe DecimalColumnStatisticsData -> ColumnStatisticsData)
-> Lens
     ColumnStatisticsData
     ColumnStatisticsData
     (Maybe DecimalColumnStatisticsData)
     (Maybe DecimalColumnStatisticsData)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnStatisticsData' {Maybe DecimalColumnStatisticsData
decimalColumnStatisticsData :: Maybe DecimalColumnStatisticsData
$sel:decimalColumnStatisticsData:ColumnStatisticsData' :: ColumnStatisticsData -> Maybe DecimalColumnStatisticsData
decimalColumnStatisticsData} -> Maybe DecimalColumnStatisticsData
decimalColumnStatisticsData) (\s :: ColumnStatisticsData
s@ColumnStatisticsData' {} Maybe DecimalColumnStatisticsData
a -> ColumnStatisticsData
s {$sel:decimalColumnStatisticsData:ColumnStatisticsData' :: Maybe DecimalColumnStatisticsData
decimalColumnStatisticsData = Maybe DecimalColumnStatisticsData
a} :: ColumnStatisticsData)

-- | Double column statistics data.
columnStatisticsData_doubleColumnStatisticsData :: Lens.Lens' ColumnStatisticsData (Prelude.Maybe DoubleColumnStatisticsData)
columnStatisticsData_doubleColumnStatisticsData :: (Maybe DoubleColumnStatisticsData
 -> f (Maybe DoubleColumnStatisticsData))
-> ColumnStatisticsData -> f ColumnStatisticsData
columnStatisticsData_doubleColumnStatisticsData = (ColumnStatisticsData -> Maybe DoubleColumnStatisticsData)
-> (ColumnStatisticsData
    -> Maybe DoubleColumnStatisticsData -> ColumnStatisticsData)
-> Lens
     ColumnStatisticsData
     ColumnStatisticsData
     (Maybe DoubleColumnStatisticsData)
     (Maybe DoubleColumnStatisticsData)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnStatisticsData' {Maybe DoubleColumnStatisticsData
doubleColumnStatisticsData :: Maybe DoubleColumnStatisticsData
$sel:doubleColumnStatisticsData:ColumnStatisticsData' :: ColumnStatisticsData -> Maybe DoubleColumnStatisticsData
doubleColumnStatisticsData} -> Maybe DoubleColumnStatisticsData
doubleColumnStatisticsData) (\s :: ColumnStatisticsData
s@ColumnStatisticsData' {} Maybe DoubleColumnStatisticsData
a -> ColumnStatisticsData
s {$sel:doubleColumnStatisticsData:ColumnStatisticsData' :: Maybe DoubleColumnStatisticsData
doubleColumnStatisticsData = Maybe DoubleColumnStatisticsData
a} :: ColumnStatisticsData)

-- | String column statistics data.
columnStatisticsData_stringColumnStatisticsData :: Lens.Lens' ColumnStatisticsData (Prelude.Maybe StringColumnStatisticsData)
columnStatisticsData_stringColumnStatisticsData :: (Maybe StringColumnStatisticsData
 -> f (Maybe StringColumnStatisticsData))
-> ColumnStatisticsData -> f ColumnStatisticsData
columnStatisticsData_stringColumnStatisticsData = (ColumnStatisticsData -> Maybe StringColumnStatisticsData)
-> (ColumnStatisticsData
    -> Maybe StringColumnStatisticsData -> ColumnStatisticsData)
-> Lens
     ColumnStatisticsData
     ColumnStatisticsData
     (Maybe StringColumnStatisticsData)
     (Maybe StringColumnStatisticsData)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnStatisticsData' {Maybe StringColumnStatisticsData
stringColumnStatisticsData :: Maybe StringColumnStatisticsData
$sel:stringColumnStatisticsData:ColumnStatisticsData' :: ColumnStatisticsData -> Maybe StringColumnStatisticsData
stringColumnStatisticsData} -> Maybe StringColumnStatisticsData
stringColumnStatisticsData) (\s :: ColumnStatisticsData
s@ColumnStatisticsData' {} Maybe StringColumnStatisticsData
a -> ColumnStatisticsData
s {$sel:stringColumnStatisticsData:ColumnStatisticsData' :: Maybe StringColumnStatisticsData
stringColumnStatisticsData = Maybe StringColumnStatisticsData
a} :: ColumnStatisticsData)

-- | Long column statistics data.
columnStatisticsData_longColumnStatisticsData :: Lens.Lens' ColumnStatisticsData (Prelude.Maybe LongColumnStatisticsData)
columnStatisticsData_longColumnStatisticsData :: (Maybe LongColumnStatisticsData
 -> f (Maybe LongColumnStatisticsData))
-> ColumnStatisticsData -> f ColumnStatisticsData
columnStatisticsData_longColumnStatisticsData = (ColumnStatisticsData -> Maybe LongColumnStatisticsData)
-> (ColumnStatisticsData
    -> Maybe LongColumnStatisticsData -> ColumnStatisticsData)
-> Lens
     ColumnStatisticsData
     ColumnStatisticsData
     (Maybe LongColumnStatisticsData)
     (Maybe LongColumnStatisticsData)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnStatisticsData' {Maybe LongColumnStatisticsData
longColumnStatisticsData :: Maybe LongColumnStatisticsData
$sel:longColumnStatisticsData:ColumnStatisticsData' :: ColumnStatisticsData -> Maybe LongColumnStatisticsData
longColumnStatisticsData} -> Maybe LongColumnStatisticsData
longColumnStatisticsData) (\s :: ColumnStatisticsData
s@ColumnStatisticsData' {} Maybe LongColumnStatisticsData
a -> ColumnStatisticsData
s {$sel:longColumnStatisticsData:ColumnStatisticsData' :: Maybe LongColumnStatisticsData
longColumnStatisticsData = Maybe LongColumnStatisticsData
a} :: ColumnStatisticsData)

-- | The type of column statistics data.
columnStatisticsData_type :: Lens.Lens' ColumnStatisticsData ColumnStatisticsType
columnStatisticsData_type :: (ColumnStatisticsType -> f ColumnStatisticsType)
-> ColumnStatisticsData -> f ColumnStatisticsData
columnStatisticsData_type = (ColumnStatisticsData -> ColumnStatisticsType)
-> (ColumnStatisticsData
    -> ColumnStatisticsType -> ColumnStatisticsData)
-> Lens
     ColumnStatisticsData
     ColumnStatisticsData
     ColumnStatisticsType
     ColumnStatisticsType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnStatisticsData' {ColumnStatisticsType
type' :: ColumnStatisticsType
$sel:type':ColumnStatisticsData' :: ColumnStatisticsData -> ColumnStatisticsType
type'} -> ColumnStatisticsType
type') (\s :: ColumnStatisticsData
s@ColumnStatisticsData' {} ColumnStatisticsType
a -> ColumnStatisticsData
s {$sel:type':ColumnStatisticsData' :: ColumnStatisticsType
type' = ColumnStatisticsType
a} :: ColumnStatisticsData)

instance Core.FromJSON ColumnStatisticsData where
  parseJSON :: Value -> Parser ColumnStatisticsData
parseJSON =
    String
-> (Object -> Parser ColumnStatisticsData)
-> Value
-> Parser ColumnStatisticsData
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ColumnStatisticsData"
      ( \Object
x ->
          Maybe BinaryColumnStatisticsData
-> Maybe DateColumnStatisticsData
-> Maybe BooleanColumnStatisticsData
-> Maybe DecimalColumnStatisticsData
-> Maybe DoubleColumnStatisticsData
-> Maybe StringColumnStatisticsData
-> Maybe LongColumnStatisticsData
-> ColumnStatisticsType
-> ColumnStatisticsData
ColumnStatisticsData'
            (Maybe BinaryColumnStatisticsData
 -> Maybe DateColumnStatisticsData
 -> Maybe BooleanColumnStatisticsData
 -> Maybe DecimalColumnStatisticsData
 -> Maybe DoubleColumnStatisticsData
 -> Maybe StringColumnStatisticsData
 -> Maybe LongColumnStatisticsData
 -> ColumnStatisticsType
 -> ColumnStatisticsData)
-> Parser (Maybe BinaryColumnStatisticsData)
-> Parser
     (Maybe DateColumnStatisticsData
      -> Maybe BooleanColumnStatisticsData
      -> Maybe DecimalColumnStatisticsData
      -> Maybe DoubleColumnStatisticsData
      -> Maybe StringColumnStatisticsData
      -> Maybe LongColumnStatisticsData
      -> ColumnStatisticsType
      -> ColumnStatisticsData)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe BinaryColumnStatisticsData)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"BinaryColumnStatisticsData")
            Parser
  (Maybe DateColumnStatisticsData
   -> Maybe BooleanColumnStatisticsData
   -> Maybe DecimalColumnStatisticsData
   -> Maybe DoubleColumnStatisticsData
   -> Maybe StringColumnStatisticsData
   -> Maybe LongColumnStatisticsData
   -> ColumnStatisticsType
   -> ColumnStatisticsData)
-> Parser (Maybe DateColumnStatisticsData)
-> Parser
     (Maybe BooleanColumnStatisticsData
      -> Maybe DecimalColumnStatisticsData
      -> Maybe DoubleColumnStatisticsData
      -> Maybe StringColumnStatisticsData
      -> Maybe LongColumnStatisticsData
      -> ColumnStatisticsType
      -> ColumnStatisticsData)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DateColumnStatisticsData)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DateColumnStatisticsData")
            Parser
  (Maybe BooleanColumnStatisticsData
   -> Maybe DecimalColumnStatisticsData
   -> Maybe DoubleColumnStatisticsData
   -> Maybe StringColumnStatisticsData
   -> Maybe LongColumnStatisticsData
   -> ColumnStatisticsType
   -> ColumnStatisticsData)
-> Parser (Maybe BooleanColumnStatisticsData)
-> Parser
     (Maybe DecimalColumnStatisticsData
      -> Maybe DoubleColumnStatisticsData
      -> Maybe StringColumnStatisticsData
      -> Maybe LongColumnStatisticsData
      -> ColumnStatisticsType
      -> ColumnStatisticsData)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe BooleanColumnStatisticsData)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"BooleanColumnStatisticsData")
            Parser
  (Maybe DecimalColumnStatisticsData
   -> Maybe DoubleColumnStatisticsData
   -> Maybe StringColumnStatisticsData
   -> Maybe LongColumnStatisticsData
   -> ColumnStatisticsType
   -> ColumnStatisticsData)
-> Parser (Maybe DecimalColumnStatisticsData)
-> Parser
     (Maybe DoubleColumnStatisticsData
      -> Maybe StringColumnStatisticsData
      -> Maybe LongColumnStatisticsData
      -> ColumnStatisticsType
      -> ColumnStatisticsData)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DecimalColumnStatisticsData)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DecimalColumnStatisticsData")
            Parser
  (Maybe DoubleColumnStatisticsData
   -> Maybe StringColumnStatisticsData
   -> Maybe LongColumnStatisticsData
   -> ColumnStatisticsType
   -> ColumnStatisticsData)
-> Parser (Maybe DoubleColumnStatisticsData)
-> Parser
     (Maybe StringColumnStatisticsData
      -> Maybe LongColumnStatisticsData
      -> ColumnStatisticsType
      -> ColumnStatisticsData)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DoubleColumnStatisticsData)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DoubleColumnStatisticsData")
            Parser
  (Maybe StringColumnStatisticsData
   -> Maybe LongColumnStatisticsData
   -> ColumnStatisticsType
   -> ColumnStatisticsData)
-> Parser (Maybe StringColumnStatisticsData)
-> Parser
     (Maybe LongColumnStatisticsData
      -> ColumnStatisticsType -> ColumnStatisticsData)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe StringColumnStatisticsData)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"StringColumnStatisticsData")
            Parser
  (Maybe LongColumnStatisticsData
   -> ColumnStatisticsType -> ColumnStatisticsData)
-> Parser (Maybe LongColumnStatisticsData)
-> Parser (ColumnStatisticsType -> ColumnStatisticsData)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe LongColumnStatisticsData)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LongColumnStatisticsData")
            Parser (ColumnStatisticsType -> ColumnStatisticsData)
-> Parser ColumnStatisticsType -> Parser ColumnStatisticsData
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ColumnStatisticsType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Type")
      )

instance Prelude.Hashable ColumnStatisticsData

instance Prelude.NFData ColumnStatisticsData

instance Core.ToJSON ColumnStatisticsData where
  toJSON :: ColumnStatisticsData -> Value
toJSON ColumnStatisticsData' {Maybe BinaryColumnStatisticsData
Maybe BooleanColumnStatisticsData
Maybe DateColumnStatisticsData
Maybe DecimalColumnStatisticsData
Maybe DoubleColumnStatisticsData
Maybe LongColumnStatisticsData
Maybe StringColumnStatisticsData
ColumnStatisticsType
type' :: ColumnStatisticsType
longColumnStatisticsData :: Maybe LongColumnStatisticsData
stringColumnStatisticsData :: Maybe StringColumnStatisticsData
doubleColumnStatisticsData :: Maybe DoubleColumnStatisticsData
decimalColumnStatisticsData :: Maybe DecimalColumnStatisticsData
booleanColumnStatisticsData :: Maybe BooleanColumnStatisticsData
dateColumnStatisticsData :: Maybe DateColumnStatisticsData
binaryColumnStatisticsData :: Maybe BinaryColumnStatisticsData
$sel:type':ColumnStatisticsData' :: ColumnStatisticsData -> ColumnStatisticsType
$sel:longColumnStatisticsData:ColumnStatisticsData' :: ColumnStatisticsData -> Maybe LongColumnStatisticsData
$sel:stringColumnStatisticsData:ColumnStatisticsData' :: ColumnStatisticsData -> Maybe StringColumnStatisticsData
$sel:doubleColumnStatisticsData:ColumnStatisticsData' :: ColumnStatisticsData -> Maybe DoubleColumnStatisticsData
$sel:decimalColumnStatisticsData:ColumnStatisticsData' :: ColumnStatisticsData -> Maybe DecimalColumnStatisticsData
$sel:booleanColumnStatisticsData:ColumnStatisticsData' :: ColumnStatisticsData -> Maybe BooleanColumnStatisticsData
$sel:dateColumnStatisticsData:ColumnStatisticsData' :: ColumnStatisticsData -> Maybe DateColumnStatisticsData
$sel:binaryColumnStatisticsData:ColumnStatisticsData' :: ColumnStatisticsData -> Maybe BinaryColumnStatisticsData
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"BinaryColumnStatisticsData" Text -> BinaryColumnStatisticsData -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (BinaryColumnStatisticsData -> Pair)
-> Maybe BinaryColumnStatisticsData -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe BinaryColumnStatisticsData
binaryColumnStatisticsData,
            (Text
"DateColumnStatisticsData" Text -> DateColumnStatisticsData -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (DateColumnStatisticsData -> Pair)
-> Maybe DateColumnStatisticsData -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DateColumnStatisticsData
dateColumnStatisticsData,
            (Text
"BooleanColumnStatisticsData" Text -> BooleanColumnStatisticsData -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (BooleanColumnStatisticsData -> Pair)
-> Maybe BooleanColumnStatisticsData -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe BooleanColumnStatisticsData
booleanColumnStatisticsData,
            (Text
"DecimalColumnStatisticsData" Text -> DecimalColumnStatisticsData -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (DecimalColumnStatisticsData -> Pair)
-> Maybe DecimalColumnStatisticsData -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DecimalColumnStatisticsData
decimalColumnStatisticsData,
            (Text
"DoubleColumnStatisticsData" Text -> DoubleColumnStatisticsData -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (DoubleColumnStatisticsData -> Pair)
-> Maybe DoubleColumnStatisticsData -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DoubleColumnStatisticsData
doubleColumnStatisticsData,
            (Text
"StringColumnStatisticsData" Text -> StringColumnStatisticsData -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (StringColumnStatisticsData -> Pair)
-> Maybe StringColumnStatisticsData -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe StringColumnStatisticsData
stringColumnStatisticsData,
            (Text
"LongColumnStatisticsData" Text -> LongColumnStatisticsData -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (LongColumnStatisticsData -> Pair)
-> Maybe LongColumnStatisticsData -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe LongColumnStatisticsData
longColumnStatisticsData,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Type" Text -> ColumnStatisticsType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ColumnStatisticsType
type')
          ]
      )