{-# 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.DataBrew.Types.ColumnStatisticsConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DataBrew.Types.ColumnSelector
import Amazonka.DataBrew.Types.StatisticsConfiguration
import qualified Amazonka.Prelude as Prelude
data ColumnStatisticsConfiguration = ColumnStatisticsConfiguration'
{
ColumnStatisticsConfiguration -> Maybe (NonEmpty ColumnSelector)
selectors :: Prelude.Maybe (Prelude.NonEmpty ColumnSelector),
ColumnStatisticsConfiguration -> StatisticsConfiguration
statistics :: StatisticsConfiguration
}
deriving (ColumnStatisticsConfiguration
-> ColumnStatisticsConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ColumnStatisticsConfiguration
-> ColumnStatisticsConfiguration -> Bool
$c/= :: ColumnStatisticsConfiguration
-> ColumnStatisticsConfiguration -> Bool
== :: ColumnStatisticsConfiguration
-> ColumnStatisticsConfiguration -> Bool
$c== :: ColumnStatisticsConfiguration
-> ColumnStatisticsConfiguration -> Bool
Prelude.Eq, ReadPrec [ColumnStatisticsConfiguration]
ReadPrec ColumnStatisticsConfiguration
Int -> ReadS ColumnStatisticsConfiguration
ReadS [ColumnStatisticsConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ColumnStatisticsConfiguration]
$creadListPrec :: ReadPrec [ColumnStatisticsConfiguration]
readPrec :: ReadPrec ColumnStatisticsConfiguration
$creadPrec :: ReadPrec ColumnStatisticsConfiguration
readList :: ReadS [ColumnStatisticsConfiguration]
$creadList :: ReadS [ColumnStatisticsConfiguration]
readsPrec :: Int -> ReadS ColumnStatisticsConfiguration
$creadsPrec :: Int -> ReadS ColumnStatisticsConfiguration
Prelude.Read, Int -> ColumnStatisticsConfiguration -> ShowS
[ColumnStatisticsConfiguration] -> ShowS
ColumnStatisticsConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ColumnStatisticsConfiguration] -> ShowS
$cshowList :: [ColumnStatisticsConfiguration] -> ShowS
show :: ColumnStatisticsConfiguration -> String
$cshow :: ColumnStatisticsConfiguration -> String
showsPrec :: Int -> ColumnStatisticsConfiguration -> ShowS
$cshowsPrec :: Int -> ColumnStatisticsConfiguration -> ShowS
Prelude.Show, forall x.
Rep ColumnStatisticsConfiguration x
-> ColumnStatisticsConfiguration
forall x.
ColumnStatisticsConfiguration
-> Rep ColumnStatisticsConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ColumnStatisticsConfiguration x
-> ColumnStatisticsConfiguration
$cfrom :: forall x.
ColumnStatisticsConfiguration
-> Rep ColumnStatisticsConfiguration x
Prelude.Generic)
newColumnStatisticsConfiguration ::
StatisticsConfiguration ->
ColumnStatisticsConfiguration
newColumnStatisticsConfiguration :: StatisticsConfiguration -> ColumnStatisticsConfiguration
newColumnStatisticsConfiguration StatisticsConfiguration
pStatistics_ =
ColumnStatisticsConfiguration'
{ $sel:selectors:ColumnStatisticsConfiguration' :: Maybe (NonEmpty ColumnSelector)
selectors =
forall a. Maybe a
Prelude.Nothing,
$sel:statistics:ColumnStatisticsConfiguration' :: StatisticsConfiguration
statistics = StatisticsConfiguration
pStatistics_
}
columnStatisticsConfiguration_selectors :: Lens.Lens' ColumnStatisticsConfiguration (Prelude.Maybe (Prelude.NonEmpty ColumnSelector))
columnStatisticsConfiguration_selectors :: Lens'
ColumnStatisticsConfiguration (Maybe (NonEmpty ColumnSelector))
columnStatisticsConfiguration_selectors = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnStatisticsConfiguration' {Maybe (NonEmpty ColumnSelector)
selectors :: Maybe (NonEmpty ColumnSelector)
$sel:selectors:ColumnStatisticsConfiguration' :: ColumnStatisticsConfiguration -> Maybe (NonEmpty ColumnSelector)
selectors} -> Maybe (NonEmpty ColumnSelector)
selectors) (\s :: ColumnStatisticsConfiguration
s@ColumnStatisticsConfiguration' {} Maybe (NonEmpty ColumnSelector)
a -> ColumnStatisticsConfiguration
s {$sel:selectors:ColumnStatisticsConfiguration' :: Maybe (NonEmpty ColumnSelector)
selectors = Maybe (NonEmpty ColumnSelector)
a} :: ColumnStatisticsConfiguration) 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
columnStatisticsConfiguration_statistics :: Lens.Lens' ColumnStatisticsConfiguration StatisticsConfiguration
columnStatisticsConfiguration_statistics :: Lens' ColumnStatisticsConfiguration StatisticsConfiguration
columnStatisticsConfiguration_statistics = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnStatisticsConfiguration' {StatisticsConfiguration
statistics :: StatisticsConfiguration
$sel:statistics:ColumnStatisticsConfiguration' :: ColumnStatisticsConfiguration -> StatisticsConfiguration
statistics} -> StatisticsConfiguration
statistics) (\s :: ColumnStatisticsConfiguration
s@ColumnStatisticsConfiguration' {} StatisticsConfiguration
a -> ColumnStatisticsConfiguration
s {$sel:statistics:ColumnStatisticsConfiguration' :: StatisticsConfiguration
statistics = StatisticsConfiguration
a} :: ColumnStatisticsConfiguration)
instance Data.FromJSON ColumnStatisticsConfiguration where
parseJSON :: Value -> Parser ColumnStatisticsConfiguration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ColumnStatisticsConfiguration"
( \Object
x ->
Maybe (NonEmpty ColumnSelector)
-> StatisticsConfiguration -> ColumnStatisticsConfiguration
ColumnStatisticsConfiguration'
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
"Selectors")
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
"Statistics")
)
instance
Prelude.Hashable
ColumnStatisticsConfiguration
where
hashWithSalt :: Int -> ColumnStatisticsConfiguration -> Int
hashWithSalt Int
_salt ColumnStatisticsConfiguration' {Maybe (NonEmpty ColumnSelector)
StatisticsConfiguration
statistics :: StatisticsConfiguration
selectors :: Maybe (NonEmpty ColumnSelector)
$sel:statistics:ColumnStatisticsConfiguration' :: ColumnStatisticsConfiguration -> StatisticsConfiguration
$sel:selectors:ColumnStatisticsConfiguration' :: ColumnStatisticsConfiguration -> Maybe (NonEmpty ColumnSelector)
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty ColumnSelector)
selectors
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` StatisticsConfiguration
statistics
instance Prelude.NFData ColumnStatisticsConfiguration where
rnf :: ColumnStatisticsConfiguration -> ()
rnf ColumnStatisticsConfiguration' {Maybe (NonEmpty ColumnSelector)
StatisticsConfiguration
statistics :: StatisticsConfiguration
selectors :: Maybe (NonEmpty ColumnSelector)
$sel:statistics:ColumnStatisticsConfiguration' :: ColumnStatisticsConfiguration -> StatisticsConfiguration
$sel:selectors:ColumnStatisticsConfiguration' :: ColumnStatisticsConfiguration -> Maybe (NonEmpty ColumnSelector)
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty ColumnSelector)
selectors
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf StatisticsConfiguration
statistics
instance Data.ToJSON ColumnStatisticsConfiguration where
toJSON :: ColumnStatisticsConfiguration -> Value
toJSON ColumnStatisticsConfiguration' {Maybe (NonEmpty ColumnSelector)
StatisticsConfiguration
statistics :: StatisticsConfiguration
selectors :: Maybe (NonEmpty ColumnSelector)
$sel:statistics:ColumnStatisticsConfiguration' :: ColumnStatisticsConfiguration -> StatisticsConfiguration
$sel:selectors:ColumnStatisticsConfiguration' :: ColumnStatisticsConfiguration -> Maybe (NonEmpty ColumnSelector)
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Selectors" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty ColumnSelector)
selectors,
forall a. a -> Maybe a
Prelude.Just (Key
"Statistics" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= StatisticsConfiguration
statistics)
]
)