{-# 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.Classifier where
import qualified Amazonka.Core as Core
import Amazonka.Glue.Types.CsvClassifier
import Amazonka.Glue.Types.GrokClassifier
import Amazonka.Glue.Types.JsonClassifier
import Amazonka.Glue.Types.XMLClassifier
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Classifier = Classifier'
{
Classifier -> Maybe GrokClassifier
grokClassifier :: Prelude.Maybe GrokClassifier,
Classifier -> Maybe XMLClassifier
xMLClassifier :: Prelude.Maybe XMLClassifier,
Classifier -> Maybe CsvClassifier
csvClassifier :: Prelude.Maybe CsvClassifier,
Classifier -> Maybe JsonClassifier
jsonClassifier :: Prelude.Maybe JsonClassifier
}
deriving (Classifier -> Classifier -> Bool
(Classifier -> Classifier -> Bool)
-> (Classifier -> Classifier -> Bool) -> Eq Classifier
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Classifier -> Classifier -> Bool
$c/= :: Classifier -> Classifier -> Bool
== :: Classifier -> Classifier -> Bool
$c== :: Classifier -> Classifier -> Bool
Prelude.Eq, ReadPrec [Classifier]
ReadPrec Classifier
Int -> ReadS Classifier
ReadS [Classifier]
(Int -> ReadS Classifier)
-> ReadS [Classifier]
-> ReadPrec Classifier
-> ReadPrec [Classifier]
-> Read Classifier
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Classifier]
$creadListPrec :: ReadPrec [Classifier]
readPrec :: ReadPrec Classifier
$creadPrec :: ReadPrec Classifier
readList :: ReadS [Classifier]
$creadList :: ReadS [Classifier]
readsPrec :: Int -> ReadS Classifier
$creadsPrec :: Int -> ReadS Classifier
Prelude.Read, Int -> Classifier -> ShowS
[Classifier] -> ShowS
Classifier -> String
(Int -> Classifier -> ShowS)
-> (Classifier -> String)
-> ([Classifier] -> ShowS)
-> Show Classifier
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Classifier] -> ShowS
$cshowList :: [Classifier] -> ShowS
show :: Classifier -> String
$cshow :: Classifier -> String
showsPrec :: Int -> Classifier -> ShowS
$cshowsPrec :: Int -> Classifier -> ShowS
Prelude.Show, (forall x. Classifier -> Rep Classifier x)
-> (forall x. Rep Classifier x -> Classifier) -> Generic Classifier
forall x. Rep Classifier x -> Classifier
forall x. Classifier -> Rep Classifier x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Classifier x -> Classifier
$cfrom :: forall x. Classifier -> Rep Classifier x
Prelude.Generic)
newClassifier ::
Classifier
newClassifier :: Classifier
newClassifier =
Classifier' :: Maybe GrokClassifier
-> Maybe XMLClassifier
-> Maybe CsvClassifier
-> Maybe JsonClassifier
-> Classifier
Classifier'
{ $sel:grokClassifier:Classifier' :: Maybe GrokClassifier
grokClassifier = Maybe GrokClassifier
forall a. Maybe a
Prelude.Nothing,
$sel:xMLClassifier:Classifier' :: Maybe XMLClassifier
xMLClassifier = Maybe XMLClassifier
forall a. Maybe a
Prelude.Nothing,
$sel:csvClassifier:Classifier' :: Maybe CsvClassifier
csvClassifier = Maybe CsvClassifier
forall a. Maybe a
Prelude.Nothing,
$sel:jsonClassifier:Classifier' :: Maybe JsonClassifier
jsonClassifier = Maybe JsonClassifier
forall a. Maybe a
Prelude.Nothing
}
classifier_grokClassifier :: Lens.Lens' Classifier (Prelude.Maybe GrokClassifier)
classifier_grokClassifier :: (Maybe GrokClassifier -> f (Maybe GrokClassifier))
-> Classifier -> f Classifier
classifier_grokClassifier = (Classifier -> Maybe GrokClassifier)
-> (Classifier -> Maybe GrokClassifier -> Classifier)
-> Lens
Classifier Classifier (Maybe GrokClassifier) (Maybe GrokClassifier)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Classifier' {Maybe GrokClassifier
grokClassifier :: Maybe GrokClassifier
$sel:grokClassifier:Classifier' :: Classifier -> Maybe GrokClassifier
grokClassifier} -> Maybe GrokClassifier
grokClassifier) (\s :: Classifier
s@Classifier' {} Maybe GrokClassifier
a -> Classifier
s {$sel:grokClassifier:Classifier' :: Maybe GrokClassifier
grokClassifier = Maybe GrokClassifier
a} :: Classifier)
classifier_xMLClassifier :: Lens.Lens' Classifier (Prelude.Maybe XMLClassifier)
classifier_xMLClassifier :: (Maybe XMLClassifier -> f (Maybe XMLClassifier))
-> Classifier -> f Classifier
classifier_xMLClassifier = (Classifier -> Maybe XMLClassifier)
-> (Classifier -> Maybe XMLClassifier -> Classifier)
-> Lens
Classifier Classifier (Maybe XMLClassifier) (Maybe XMLClassifier)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Classifier' {Maybe XMLClassifier
xMLClassifier :: Maybe XMLClassifier
$sel:xMLClassifier:Classifier' :: Classifier -> Maybe XMLClassifier
xMLClassifier} -> Maybe XMLClassifier
xMLClassifier) (\s :: Classifier
s@Classifier' {} Maybe XMLClassifier
a -> Classifier
s {$sel:xMLClassifier:Classifier' :: Maybe XMLClassifier
xMLClassifier = Maybe XMLClassifier
a} :: Classifier)
classifier_csvClassifier :: Lens.Lens' Classifier (Prelude.Maybe CsvClassifier)
classifier_csvClassifier :: (Maybe CsvClassifier -> f (Maybe CsvClassifier))
-> Classifier -> f Classifier
classifier_csvClassifier = (Classifier -> Maybe CsvClassifier)
-> (Classifier -> Maybe CsvClassifier -> Classifier)
-> Lens
Classifier Classifier (Maybe CsvClassifier) (Maybe CsvClassifier)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Classifier' {Maybe CsvClassifier
csvClassifier :: Maybe CsvClassifier
$sel:csvClassifier:Classifier' :: Classifier -> Maybe CsvClassifier
csvClassifier} -> Maybe CsvClassifier
csvClassifier) (\s :: Classifier
s@Classifier' {} Maybe CsvClassifier
a -> Classifier
s {$sel:csvClassifier:Classifier' :: Maybe CsvClassifier
csvClassifier = Maybe CsvClassifier
a} :: Classifier)
classifier_jsonClassifier :: Lens.Lens' Classifier (Prelude.Maybe JsonClassifier)
classifier_jsonClassifier :: (Maybe JsonClassifier -> f (Maybe JsonClassifier))
-> Classifier -> f Classifier
classifier_jsonClassifier = (Classifier -> Maybe JsonClassifier)
-> (Classifier -> Maybe JsonClassifier -> Classifier)
-> Lens
Classifier Classifier (Maybe JsonClassifier) (Maybe JsonClassifier)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Classifier' {Maybe JsonClassifier
jsonClassifier :: Maybe JsonClassifier
$sel:jsonClassifier:Classifier' :: Classifier -> Maybe JsonClassifier
jsonClassifier} -> Maybe JsonClassifier
jsonClassifier) (\s :: Classifier
s@Classifier' {} Maybe JsonClassifier
a -> Classifier
s {$sel:jsonClassifier:Classifier' :: Maybe JsonClassifier
jsonClassifier = Maybe JsonClassifier
a} :: Classifier)
instance Core.FromJSON Classifier where
parseJSON :: Value -> Parser Classifier
parseJSON =
String
-> (Object -> Parser Classifier) -> Value -> Parser Classifier
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Classifier"
( \Object
x ->
Maybe GrokClassifier
-> Maybe XMLClassifier
-> Maybe CsvClassifier
-> Maybe JsonClassifier
-> Classifier
Classifier'
(Maybe GrokClassifier
-> Maybe XMLClassifier
-> Maybe CsvClassifier
-> Maybe JsonClassifier
-> Classifier)
-> Parser (Maybe GrokClassifier)
-> Parser
(Maybe XMLClassifier
-> Maybe CsvClassifier -> Maybe JsonClassifier -> Classifier)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe GrokClassifier)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"GrokClassifier")
Parser
(Maybe XMLClassifier
-> Maybe CsvClassifier -> Maybe JsonClassifier -> Classifier)
-> Parser (Maybe XMLClassifier)
-> Parser
(Maybe CsvClassifier -> Maybe JsonClassifier -> Classifier)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe XMLClassifier)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"XMLClassifier")
Parser (Maybe CsvClassifier -> Maybe JsonClassifier -> Classifier)
-> Parser (Maybe CsvClassifier)
-> Parser (Maybe JsonClassifier -> Classifier)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CsvClassifier)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CsvClassifier")
Parser (Maybe JsonClassifier -> Classifier)
-> Parser (Maybe JsonClassifier) -> Parser Classifier
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe JsonClassifier)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"JsonClassifier")
)
instance Prelude.Hashable Classifier
instance Prelude.NFData Classifier