{-# 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 Amazonka.DataBrew.Types.ColumnSelector
import Amazonka.DataBrew.Types.StatisticsConfiguration
import qualified Amazonka.Lens as Lens
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
(ColumnStatisticsConfiguration
-> ColumnStatisticsConfiguration -> Bool)
-> (ColumnStatisticsConfiguration
-> ColumnStatisticsConfiguration -> Bool)
-> Eq ColumnStatisticsConfiguration
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]
(Int -> ReadS ColumnStatisticsConfiguration)
-> ReadS [ColumnStatisticsConfiguration]
-> ReadPrec ColumnStatisticsConfiguration
-> ReadPrec [ColumnStatisticsConfiguration]
-> Read 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
(Int -> ColumnStatisticsConfiguration -> ShowS)
-> (ColumnStatisticsConfiguration -> String)
-> ([ColumnStatisticsConfiguration] -> ShowS)
-> Show ColumnStatisticsConfiguration
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.
ColumnStatisticsConfiguration
-> Rep ColumnStatisticsConfiguration x)
-> (forall x.
Rep ColumnStatisticsConfiguration x
-> ColumnStatisticsConfiguration)
-> Generic ColumnStatisticsConfiguration
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' :: Maybe (NonEmpty ColumnSelector)
-> StatisticsConfiguration -> ColumnStatisticsConfiguration
ColumnStatisticsConfiguration'
{ $sel:selectors:ColumnStatisticsConfiguration' :: Maybe (NonEmpty ColumnSelector)
selectors =
Maybe (NonEmpty ColumnSelector)
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 :: (Maybe (NonEmpty ColumnSelector)
-> f (Maybe (NonEmpty ColumnSelector)))
-> ColumnStatisticsConfiguration -> f ColumnStatisticsConfiguration
columnStatisticsConfiguration_selectors = (ColumnStatisticsConfiguration -> Maybe (NonEmpty ColumnSelector))
-> (ColumnStatisticsConfiguration
-> Maybe (NonEmpty ColumnSelector)
-> ColumnStatisticsConfiguration)
-> Lens
ColumnStatisticsConfiguration
ColumnStatisticsConfiguration
(Maybe (NonEmpty ColumnSelector))
(Maybe (NonEmpty ColumnSelector))
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) ((Maybe (NonEmpty ColumnSelector)
-> f (Maybe (NonEmpty ColumnSelector)))
-> ColumnStatisticsConfiguration
-> f ColumnStatisticsConfiguration)
-> ((Maybe (NonEmpty ColumnSelector)
-> f (Maybe (NonEmpty ColumnSelector)))
-> Maybe (NonEmpty ColumnSelector)
-> f (Maybe (NonEmpty ColumnSelector)))
-> (Maybe (NonEmpty ColumnSelector)
-> f (Maybe (NonEmpty ColumnSelector)))
-> ColumnStatisticsConfiguration
-> f ColumnStatisticsConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty ColumnSelector)
(NonEmpty ColumnSelector)
(NonEmpty ColumnSelector)
(NonEmpty ColumnSelector)
-> Iso
(Maybe (NonEmpty ColumnSelector))
(Maybe (NonEmpty ColumnSelector))
(Maybe (NonEmpty ColumnSelector))
(Maybe (NonEmpty ColumnSelector))
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 AnIso
(NonEmpty ColumnSelector)
(NonEmpty ColumnSelector)
(NonEmpty ColumnSelector)
(NonEmpty ColumnSelector)
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 :: (StatisticsConfiguration -> f StatisticsConfiguration)
-> ColumnStatisticsConfiguration -> f ColumnStatisticsConfiguration
columnStatisticsConfiguration_statistics = (ColumnStatisticsConfiguration -> StatisticsConfiguration)
-> (ColumnStatisticsConfiguration
-> StatisticsConfiguration -> ColumnStatisticsConfiguration)
-> Lens
ColumnStatisticsConfiguration
ColumnStatisticsConfiguration
StatisticsConfiguration
StatisticsConfiguration
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 Core.FromJSON ColumnStatisticsConfiguration where
parseJSON :: Value -> Parser ColumnStatisticsConfiguration
parseJSON =
String
-> (Object -> Parser ColumnStatisticsConfiguration)
-> Value
-> Parser ColumnStatisticsConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ColumnStatisticsConfiguration"
( \Object
x ->
Maybe (NonEmpty ColumnSelector)
-> StatisticsConfiguration -> ColumnStatisticsConfiguration
ColumnStatisticsConfiguration'
(Maybe (NonEmpty ColumnSelector)
-> StatisticsConfiguration -> ColumnStatisticsConfiguration)
-> Parser (Maybe (NonEmpty ColumnSelector))
-> Parser
(StatisticsConfiguration -> ColumnStatisticsConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (NonEmpty ColumnSelector))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Selectors")
Parser (StatisticsConfiguration -> ColumnStatisticsConfiguration)
-> Parser StatisticsConfiguration
-> Parser ColumnStatisticsConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser StatisticsConfiguration
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Statistics")
)
instance
Prelude.Hashable
ColumnStatisticsConfiguration
instance Prelude.NFData ColumnStatisticsConfiguration
instance Core.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
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Selectors" Text -> NonEmpty ColumnSelector -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty ColumnSelector -> Pair)
-> Maybe (NonEmpty ColumnSelector) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty ColumnSelector)
selectors,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Statistics" Text -> StatisticsConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= StatisticsConfiguration
statistics)
]
)