{-# 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.SkewedInfo where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SkewedInfo = SkewedInfo'
{
SkewedInfo -> Maybe (HashMap Text Text)
skewedColumnValueLocationMaps :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
SkewedInfo -> Maybe [Text]
skewedColumnValues :: Prelude.Maybe [Prelude.Text],
SkewedInfo -> Maybe [Text]
skewedColumnNames :: Prelude.Maybe [Prelude.Text]
}
deriving (SkewedInfo -> SkewedInfo -> Bool
(SkewedInfo -> SkewedInfo -> Bool)
-> (SkewedInfo -> SkewedInfo -> Bool) -> Eq SkewedInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SkewedInfo -> SkewedInfo -> Bool
$c/= :: SkewedInfo -> SkewedInfo -> Bool
== :: SkewedInfo -> SkewedInfo -> Bool
$c== :: SkewedInfo -> SkewedInfo -> Bool
Prelude.Eq, ReadPrec [SkewedInfo]
ReadPrec SkewedInfo
Int -> ReadS SkewedInfo
ReadS [SkewedInfo]
(Int -> ReadS SkewedInfo)
-> ReadS [SkewedInfo]
-> ReadPrec SkewedInfo
-> ReadPrec [SkewedInfo]
-> Read SkewedInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SkewedInfo]
$creadListPrec :: ReadPrec [SkewedInfo]
readPrec :: ReadPrec SkewedInfo
$creadPrec :: ReadPrec SkewedInfo
readList :: ReadS [SkewedInfo]
$creadList :: ReadS [SkewedInfo]
readsPrec :: Int -> ReadS SkewedInfo
$creadsPrec :: Int -> ReadS SkewedInfo
Prelude.Read, Int -> SkewedInfo -> ShowS
[SkewedInfo] -> ShowS
SkewedInfo -> String
(Int -> SkewedInfo -> ShowS)
-> (SkewedInfo -> String)
-> ([SkewedInfo] -> ShowS)
-> Show SkewedInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SkewedInfo] -> ShowS
$cshowList :: [SkewedInfo] -> ShowS
show :: SkewedInfo -> String
$cshow :: SkewedInfo -> String
showsPrec :: Int -> SkewedInfo -> ShowS
$cshowsPrec :: Int -> SkewedInfo -> ShowS
Prelude.Show, (forall x. SkewedInfo -> Rep SkewedInfo x)
-> (forall x. Rep SkewedInfo x -> SkewedInfo) -> Generic SkewedInfo
forall x. Rep SkewedInfo x -> SkewedInfo
forall x. SkewedInfo -> Rep SkewedInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SkewedInfo x -> SkewedInfo
$cfrom :: forall x. SkewedInfo -> Rep SkewedInfo x
Prelude.Generic)
newSkewedInfo ::
SkewedInfo
newSkewedInfo :: SkewedInfo
newSkewedInfo =
SkewedInfo' :: Maybe (HashMap Text Text)
-> Maybe [Text] -> Maybe [Text] -> SkewedInfo
SkewedInfo'
{ $sel:skewedColumnValueLocationMaps:SkewedInfo' :: Maybe (HashMap Text Text)
skewedColumnValueLocationMaps =
Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:skewedColumnValues:SkewedInfo' :: Maybe [Text]
skewedColumnValues = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:skewedColumnNames:SkewedInfo' :: Maybe [Text]
skewedColumnNames = Maybe [Text]
forall a. Maybe a
Prelude.Nothing
}
skewedInfo_skewedColumnValueLocationMaps :: Lens.Lens' SkewedInfo (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
skewedInfo_skewedColumnValueLocationMaps :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> SkewedInfo -> f SkewedInfo
skewedInfo_skewedColumnValueLocationMaps = (SkewedInfo -> Maybe (HashMap Text Text))
-> (SkewedInfo -> Maybe (HashMap Text Text) -> SkewedInfo)
-> Lens
SkewedInfo
SkewedInfo
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SkewedInfo' {Maybe (HashMap Text Text)
skewedColumnValueLocationMaps :: Maybe (HashMap Text Text)
$sel:skewedColumnValueLocationMaps:SkewedInfo' :: SkewedInfo -> Maybe (HashMap Text Text)
skewedColumnValueLocationMaps} -> Maybe (HashMap Text Text)
skewedColumnValueLocationMaps) (\s :: SkewedInfo
s@SkewedInfo' {} Maybe (HashMap Text Text)
a -> SkewedInfo
s {$sel:skewedColumnValueLocationMaps:SkewedInfo' :: Maybe (HashMap Text Text)
skewedColumnValueLocationMaps = Maybe (HashMap Text Text)
a} :: SkewedInfo) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> SkewedInfo -> f SkewedInfo)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> SkewedInfo
-> f SkewedInfo
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
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
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
skewedInfo_skewedColumnValues :: Lens.Lens' SkewedInfo (Prelude.Maybe [Prelude.Text])
skewedInfo_skewedColumnValues :: (Maybe [Text] -> f (Maybe [Text])) -> SkewedInfo -> f SkewedInfo
skewedInfo_skewedColumnValues = (SkewedInfo -> Maybe [Text])
-> (SkewedInfo -> Maybe [Text] -> SkewedInfo)
-> Lens SkewedInfo SkewedInfo (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SkewedInfo' {Maybe [Text]
skewedColumnValues :: Maybe [Text]
$sel:skewedColumnValues:SkewedInfo' :: SkewedInfo -> Maybe [Text]
skewedColumnValues} -> Maybe [Text]
skewedColumnValues) (\s :: SkewedInfo
s@SkewedInfo' {} Maybe [Text]
a -> SkewedInfo
s {$sel:skewedColumnValues:SkewedInfo' :: Maybe [Text]
skewedColumnValues = Maybe [Text]
a} :: SkewedInfo) ((Maybe [Text] -> f (Maybe [Text])) -> SkewedInfo -> f SkewedInfo)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> SkewedInfo
-> f SkewedInfo
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
skewedInfo_skewedColumnNames :: Lens.Lens' SkewedInfo (Prelude.Maybe [Prelude.Text])
skewedInfo_skewedColumnNames :: (Maybe [Text] -> f (Maybe [Text])) -> SkewedInfo -> f SkewedInfo
skewedInfo_skewedColumnNames = (SkewedInfo -> Maybe [Text])
-> (SkewedInfo -> Maybe [Text] -> SkewedInfo)
-> Lens SkewedInfo SkewedInfo (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SkewedInfo' {Maybe [Text]
skewedColumnNames :: Maybe [Text]
$sel:skewedColumnNames:SkewedInfo' :: SkewedInfo -> Maybe [Text]
skewedColumnNames} -> Maybe [Text]
skewedColumnNames) (\s :: SkewedInfo
s@SkewedInfo' {} Maybe [Text]
a -> SkewedInfo
s {$sel:skewedColumnNames:SkewedInfo' :: Maybe [Text]
skewedColumnNames = Maybe [Text]
a} :: SkewedInfo) ((Maybe [Text] -> f (Maybe [Text])) -> SkewedInfo -> f SkewedInfo)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> SkewedInfo
-> f SkewedInfo
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON SkewedInfo where
parseJSON :: Value -> Parser SkewedInfo
parseJSON =
String
-> (Object -> Parser SkewedInfo) -> Value -> Parser SkewedInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SkewedInfo"
( \Object
x ->
Maybe (HashMap Text Text)
-> Maybe [Text] -> Maybe [Text] -> SkewedInfo
SkewedInfo'
(Maybe (HashMap Text Text)
-> Maybe [Text] -> Maybe [Text] -> SkewedInfo)
-> Parser (Maybe (HashMap Text Text))
-> Parser (Maybe [Text] -> Maybe [Text] -> SkewedInfo)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SkewedColumnValueLocationMaps"
Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty
)
Parser (Maybe [Text] -> Maybe [Text] -> SkewedInfo)
-> Parser (Maybe [Text]) -> Parser (Maybe [Text] -> SkewedInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SkewedColumnValues"
Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
)
Parser (Maybe [Text] -> SkewedInfo)
-> Parser (Maybe [Text]) -> Parser SkewedInfo
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SkewedColumnNames"
Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
)
)
instance Prelude.Hashable SkewedInfo
instance Prelude.NFData SkewedInfo
instance Core.ToJSON SkewedInfo where
toJSON :: SkewedInfo -> Value
toJSON SkewedInfo' {Maybe [Text]
Maybe (HashMap Text Text)
skewedColumnNames :: Maybe [Text]
skewedColumnValues :: Maybe [Text]
skewedColumnValueLocationMaps :: Maybe (HashMap Text Text)
$sel:skewedColumnNames:SkewedInfo' :: SkewedInfo -> Maybe [Text]
$sel:skewedColumnValues:SkewedInfo' :: SkewedInfo -> Maybe [Text]
$sel:skewedColumnValueLocationMaps:SkewedInfo' :: SkewedInfo -> Maybe (HashMap Text Text)
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"SkewedColumnValueLocationMaps" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
skewedColumnValueLocationMaps,
(Text
"SkewedColumnValues" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
skewedColumnValues,
(Text
"SkewedColumnNames" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
skewedColumnNames
]
)