{-# 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.StatisticOverride where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data StatisticOverride = StatisticOverride'
{
StatisticOverride -> Text
statistic :: Prelude.Text,
StatisticOverride -> HashMap Text Text
parameters :: Prelude.HashMap Prelude.Text Prelude.Text
}
deriving (StatisticOverride -> StatisticOverride -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StatisticOverride -> StatisticOverride -> Bool
$c/= :: StatisticOverride -> StatisticOverride -> Bool
== :: StatisticOverride -> StatisticOverride -> Bool
$c== :: StatisticOverride -> StatisticOverride -> Bool
Prelude.Eq, ReadPrec [StatisticOverride]
ReadPrec StatisticOverride
Int -> ReadS StatisticOverride
ReadS [StatisticOverride]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StatisticOverride]
$creadListPrec :: ReadPrec [StatisticOverride]
readPrec :: ReadPrec StatisticOverride
$creadPrec :: ReadPrec StatisticOverride
readList :: ReadS [StatisticOverride]
$creadList :: ReadS [StatisticOverride]
readsPrec :: Int -> ReadS StatisticOverride
$creadsPrec :: Int -> ReadS StatisticOverride
Prelude.Read, Int -> StatisticOverride -> ShowS
[StatisticOverride] -> ShowS
StatisticOverride -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StatisticOverride] -> ShowS
$cshowList :: [StatisticOverride] -> ShowS
show :: StatisticOverride -> String
$cshow :: StatisticOverride -> String
showsPrec :: Int -> StatisticOverride -> ShowS
$cshowsPrec :: Int -> StatisticOverride -> ShowS
Prelude.Show, forall x. Rep StatisticOverride x -> StatisticOverride
forall x. StatisticOverride -> Rep StatisticOverride x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StatisticOverride x -> StatisticOverride
$cfrom :: forall x. StatisticOverride -> Rep StatisticOverride x
Prelude.Generic)
newStatisticOverride ::
Prelude.Text ->
StatisticOverride
newStatisticOverride :: Text -> StatisticOverride
newStatisticOverride Text
pStatistic_ =
StatisticOverride'
{ $sel:statistic:StatisticOverride' :: Text
statistic = Text
pStatistic_,
$sel:parameters:StatisticOverride' :: HashMap Text Text
parameters = forall a. Monoid a => a
Prelude.mempty
}
statisticOverride_statistic :: Lens.Lens' StatisticOverride Prelude.Text
statisticOverride_statistic :: Lens' StatisticOverride Text
statisticOverride_statistic = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StatisticOverride' {Text
statistic :: Text
$sel:statistic:StatisticOverride' :: StatisticOverride -> Text
statistic} -> Text
statistic) (\s :: StatisticOverride
s@StatisticOverride' {} Text
a -> StatisticOverride
s {$sel:statistic:StatisticOverride' :: Text
statistic = Text
a} :: StatisticOverride)
statisticOverride_parameters :: Lens.Lens' StatisticOverride (Prelude.HashMap Prelude.Text Prelude.Text)
statisticOverride_parameters :: Lens' StatisticOverride (HashMap Text Text)
statisticOverride_parameters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StatisticOverride' {HashMap Text Text
parameters :: HashMap Text Text
$sel:parameters:StatisticOverride' :: StatisticOverride -> HashMap Text Text
parameters} -> HashMap Text Text
parameters) (\s :: StatisticOverride
s@StatisticOverride' {} HashMap Text Text
a -> StatisticOverride
s {$sel:parameters:StatisticOverride' :: HashMap Text Text
parameters = HashMap Text Text
a} :: StatisticOverride) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Data.FromJSON StatisticOverride where
parseJSON :: Value -> Parser StatisticOverride
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"StatisticOverride"
( \Object
x ->
Text -> HashMap Text Text -> StatisticOverride
StatisticOverride'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Statistic")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Parameters" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable StatisticOverride where
hashWithSalt :: Int -> StatisticOverride -> Int
hashWithSalt Int
_salt StatisticOverride' {Text
HashMap Text Text
parameters :: HashMap Text Text
statistic :: Text
$sel:parameters:StatisticOverride' :: StatisticOverride -> HashMap Text Text
$sel:statistic:StatisticOverride' :: StatisticOverride -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
statistic
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` HashMap Text Text
parameters
instance Prelude.NFData StatisticOverride where
rnf :: StatisticOverride -> ()
rnf StatisticOverride' {Text
HashMap Text Text
parameters :: HashMap Text Text
statistic :: Text
$sel:parameters:StatisticOverride' :: StatisticOverride -> HashMap Text Text
$sel:statistic:StatisticOverride' :: StatisticOverride -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
statistic
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf HashMap Text Text
parameters
instance Data.ToJSON StatisticOverride where
toJSON :: StatisticOverride -> Value
toJSON StatisticOverride' {Text
HashMap Text Text
parameters :: HashMap Text Text
statistic :: Text
$sel:parameters:StatisticOverride' :: StatisticOverride -> HashMap Text Text
$sel:statistic:StatisticOverride' :: StatisticOverride -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"Statistic" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
statistic),
forall a. a -> Maybe a
Prelude.Just (Key
"Parameters" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= HashMap Text Text
parameters)
]
)