{-# 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.CreateGrokClassifierRequest where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data CreateGrokClassifierRequest = CreateGrokClassifierRequest'
{
CreateGrokClassifierRequest -> Maybe Text
customPatterns :: Prelude.Maybe Prelude.Text,
CreateGrokClassifierRequest -> Text
classification :: Prelude.Text,
CreateGrokClassifierRequest -> Text
name :: Prelude.Text,
CreateGrokClassifierRequest -> Text
grokPattern :: Prelude.Text
}
deriving (CreateGrokClassifierRequest -> CreateGrokClassifierRequest -> Bool
(CreateGrokClassifierRequest
-> CreateGrokClassifierRequest -> Bool)
-> (CreateGrokClassifierRequest
-> CreateGrokClassifierRequest -> Bool)
-> Eq CreateGrokClassifierRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateGrokClassifierRequest -> CreateGrokClassifierRequest -> Bool
$c/= :: CreateGrokClassifierRequest -> CreateGrokClassifierRequest -> Bool
== :: CreateGrokClassifierRequest -> CreateGrokClassifierRequest -> Bool
$c== :: CreateGrokClassifierRequest -> CreateGrokClassifierRequest -> Bool
Prelude.Eq, ReadPrec [CreateGrokClassifierRequest]
ReadPrec CreateGrokClassifierRequest
Int -> ReadS CreateGrokClassifierRequest
ReadS [CreateGrokClassifierRequest]
(Int -> ReadS CreateGrokClassifierRequest)
-> ReadS [CreateGrokClassifierRequest]
-> ReadPrec CreateGrokClassifierRequest
-> ReadPrec [CreateGrokClassifierRequest]
-> Read CreateGrokClassifierRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateGrokClassifierRequest]
$creadListPrec :: ReadPrec [CreateGrokClassifierRequest]
readPrec :: ReadPrec CreateGrokClassifierRequest
$creadPrec :: ReadPrec CreateGrokClassifierRequest
readList :: ReadS [CreateGrokClassifierRequest]
$creadList :: ReadS [CreateGrokClassifierRequest]
readsPrec :: Int -> ReadS CreateGrokClassifierRequest
$creadsPrec :: Int -> ReadS CreateGrokClassifierRequest
Prelude.Read, Int -> CreateGrokClassifierRequest -> ShowS
[CreateGrokClassifierRequest] -> ShowS
CreateGrokClassifierRequest -> String
(Int -> CreateGrokClassifierRequest -> ShowS)
-> (CreateGrokClassifierRequest -> String)
-> ([CreateGrokClassifierRequest] -> ShowS)
-> Show CreateGrokClassifierRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateGrokClassifierRequest] -> ShowS
$cshowList :: [CreateGrokClassifierRequest] -> ShowS
show :: CreateGrokClassifierRequest -> String
$cshow :: CreateGrokClassifierRequest -> String
showsPrec :: Int -> CreateGrokClassifierRequest -> ShowS
$cshowsPrec :: Int -> CreateGrokClassifierRequest -> ShowS
Prelude.Show, (forall x.
CreateGrokClassifierRequest -> Rep CreateGrokClassifierRequest x)
-> (forall x.
Rep CreateGrokClassifierRequest x -> CreateGrokClassifierRequest)
-> Generic CreateGrokClassifierRequest
forall x.
Rep CreateGrokClassifierRequest x -> CreateGrokClassifierRequest
forall x.
CreateGrokClassifierRequest -> Rep CreateGrokClassifierRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateGrokClassifierRequest x -> CreateGrokClassifierRequest
$cfrom :: forall x.
CreateGrokClassifierRequest -> Rep CreateGrokClassifierRequest x
Prelude.Generic)
newCreateGrokClassifierRequest ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
CreateGrokClassifierRequest
newCreateGrokClassifierRequest :: Text -> Text -> Text -> CreateGrokClassifierRequest
newCreateGrokClassifierRequest
Text
pClassification_
Text
pName_
Text
pGrokPattern_ =
CreateGrokClassifierRequest' :: Maybe Text -> Text -> Text -> Text -> CreateGrokClassifierRequest
CreateGrokClassifierRequest'
{ $sel:customPatterns:CreateGrokClassifierRequest' :: Maybe Text
customPatterns =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:classification:CreateGrokClassifierRequest' :: Text
classification = Text
pClassification_,
$sel:name:CreateGrokClassifierRequest' :: Text
name = Text
pName_,
$sel:grokPattern:CreateGrokClassifierRequest' :: Text
grokPattern = Text
pGrokPattern_
}
createGrokClassifierRequest_customPatterns :: Lens.Lens' CreateGrokClassifierRequest (Prelude.Maybe Prelude.Text)
createGrokClassifierRequest_customPatterns :: (Maybe Text -> f (Maybe Text))
-> CreateGrokClassifierRequest -> f CreateGrokClassifierRequest
createGrokClassifierRequest_customPatterns = (CreateGrokClassifierRequest -> Maybe Text)
-> (CreateGrokClassifierRequest
-> Maybe Text -> CreateGrokClassifierRequest)
-> Lens
CreateGrokClassifierRequest
CreateGrokClassifierRequest
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateGrokClassifierRequest' {Maybe Text
customPatterns :: Maybe Text
$sel:customPatterns:CreateGrokClassifierRequest' :: CreateGrokClassifierRequest -> Maybe Text
customPatterns} -> Maybe Text
customPatterns) (\s :: CreateGrokClassifierRequest
s@CreateGrokClassifierRequest' {} Maybe Text
a -> CreateGrokClassifierRequest
s {$sel:customPatterns:CreateGrokClassifierRequest' :: Maybe Text
customPatterns = Maybe Text
a} :: CreateGrokClassifierRequest)
createGrokClassifierRequest_classification :: Lens.Lens' CreateGrokClassifierRequest Prelude.Text
createGrokClassifierRequest_classification :: (Text -> f Text)
-> CreateGrokClassifierRequest -> f CreateGrokClassifierRequest
createGrokClassifierRequest_classification = (CreateGrokClassifierRequest -> Text)
-> (CreateGrokClassifierRequest
-> Text -> CreateGrokClassifierRequest)
-> Lens
CreateGrokClassifierRequest CreateGrokClassifierRequest Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateGrokClassifierRequest' {Text
classification :: Text
$sel:classification:CreateGrokClassifierRequest' :: CreateGrokClassifierRequest -> Text
classification} -> Text
classification) (\s :: CreateGrokClassifierRequest
s@CreateGrokClassifierRequest' {} Text
a -> CreateGrokClassifierRequest
s {$sel:classification:CreateGrokClassifierRequest' :: Text
classification = Text
a} :: CreateGrokClassifierRequest)
createGrokClassifierRequest_name :: Lens.Lens' CreateGrokClassifierRequest Prelude.Text
createGrokClassifierRequest_name :: (Text -> f Text)
-> CreateGrokClassifierRequest -> f CreateGrokClassifierRequest
createGrokClassifierRequest_name = (CreateGrokClassifierRequest -> Text)
-> (CreateGrokClassifierRequest
-> Text -> CreateGrokClassifierRequest)
-> Lens
CreateGrokClassifierRequest CreateGrokClassifierRequest Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateGrokClassifierRequest' {Text
name :: Text
$sel:name:CreateGrokClassifierRequest' :: CreateGrokClassifierRequest -> Text
name} -> Text
name) (\s :: CreateGrokClassifierRequest
s@CreateGrokClassifierRequest' {} Text
a -> CreateGrokClassifierRequest
s {$sel:name:CreateGrokClassifierRequest' :: Text
name = Text
a} :: CreateGrokClassifierRequest)
createGrokClassifierRequest_grokPattern :: Lens.Lens' CreateGrokClassifierRequest Prelude.Text
createGrokClassifierRequest_grokPattern :: (Text -> f Text)
-> CreateGrokClassifierRequest -> f CreateGrokClassifierRequest
createGrokClassifierRequest_grokPattern = (CreateGrokClassifierRequest -> Text)
-> (CreateGrokClassifierRequest
-> Text -> CreateGrokClassifierRequest)
-> Lens
CreateGrokClassifierRequest CreateGrokClassifierRequest Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateGrokClassifierRequest' {Text
grokPattern :: Text
$sel:grokPattern:CreateGrokClassifierRequest' :: CreateGrokClassifierRequest -> Text
grokPattern} -> Text
grokPattern) (\s :: CreateGrokClassifierRequest
s@CreateGrokClassifierRequest' {} Text
a -> CreateGrokClassifierRequest
s {$sel:grokPattern:CreateGrokClassifierRequest' :: Text
grokPattern = Text
a} :: CreateGrokClassifierRequest)
instance Prelude.Hashable CreateGrokClassifierRequest
instance Prelude.NFData CreateGrokClassifierRequest
instance Core.ToJSON CreateGrokClassifierRequest where
toJSON :: CreateGrokClassifierRequest -> Value
toJSON CreateGrokClassifierRequest' {Maybe Text
Text
grokPattern :: Text
name :: Text
classification :: Text
customPatterns :: Maybe Text
$sel:grokPattern:CreateGrokClassifierRequest' :: CreateGrokClassifierRequest -> Text
$sel:name:CreateGrokClassifierRequest' :: CreateGrokClassifierRequest -> Text
$sel:classification:CreateGrokClassifierRequest' :: CreateGrokClassifierRequest -> Text
$sel:customPatterns:CreateGrokClassifierRequest' :: CreateGrokClassifierRequest -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"CustomPatterns" 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
customPatterns,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"Classification" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
classification),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"GrokPattern" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
grokPattern)
]
)