{-# 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.CodeGenNodeArg where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data CodeGenNodeArg = CodeGenNodeArg'
{
CodeGenNodeArg -> Maybe Bool
param :: Prelude.Maybe Prelude.Bool,
CodeGenNodeArg -> Text
name :: Prelude.Text,
CodeGenNodeArg -> Text
value :: Prelude.Text
}
deriving (CodeGenNodeArg -> CodeGenNodeArg -> Bool
(CodeGenNodeArg -> CodeGenNodeArg -> Bool)
-> (CodeGenNodeArg -> CodeGenNodeArg -> Bool) -> Eq CodeGenNodeArg
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CodeGenNodeArg -> CodeGenNodeArg -> Bool
$c/= :: CodeGenNodeArg -> CodeGenNodeArg -> Bool
== :: CodeGenNodeArg -> CodeGenNodeArg -> Bool
$c== :: CodeGenNodeArg -> CodeGenNodeArg -> Bool
Prelude.Eq, ReadPrec [CodeGenNodeArg]
ReadPrec CodeGenNodeArg
Int -> ReadS CodeGenNodeArg
ReadS [CodeGenNodeArg]
(Int -> ReadS CodeGenNodeArg)
-> ReadS [CodeGenNodeArg]
-> ReadPrec CodeGenNodeArg
-> ReadPrec [CodeGenNodeArg]
-> Read CodeGenNodeArg
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CodeGenNodeArg]
$creadListPrec :: ReadPrec [CodeGenNodeArg]
readPrec :: ReadPrec CodeGenNodeArg
$creadPrec :: ReadPrec CodeGenNodeArg
readList :: ReadS [CodeGenNodeArg]
$creadList :: ReadS [CodeGenNodeArg]
readsPrec :: Int -> ReadS CodeGenNodeArg
$creadsPrec :: Int -> ReadS CodeGenNodeArg
Prelude.Read, Int -> CodeGenNodeArg -> ShowS
[CodeGenNodeArg] -> ShowS
CodeGenNodeArg -> String
(Int -> CodeGenNodeArg -> ShowS)
-> (CodeGenNodeArg -> String)
-> ([CodeGenNodeArg] -> ShowS)
-> Show CodeGenNodeArg
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CodeGenNodeArg] -> ShowS
$cshowList :: [CodeGenNodeArg] -> ShowS
show :: CodeGenNodeArg -> String
$cshow :: CodeGenNodeArg -> String
showsPrec :: Int -> CodeGenNodeArg -> ShowS
$cshowsPrec :: Int -> CodeGenNodeArg -> ShowS
Prelude.Show, (forall x. CodeGenNodeArg -> Rep CodeGenNodeArg x)
-> (forall x. Rep CodeGenNodeArg x -> CodeGenNodeArg)
-> Generic CodeGenNodeArg
forall x. Rep CodeGenNodeArg x -> CodeGenNodeArg
forall x. CodeGenNodeArg -> Rep CodeGenNodeArg x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CodeGenNodeArg x -> CodeGenNodeArg
$cfrom :: forall x. CodeGenNodeArg -> Rep CodeGenNodeArg x
Prelude.Generic)
newCodeGenNodeArg ::
Prelude.Text ->
Prelude.Text ->
CodeGenNodeArg
newCodeGenNodeArg :: Text -> Text -> CodeGenNodeArg
newCodeGenNodeArg Text
pName_ Text
pValue_ =
CodeGenNodeArg' :: Maybe Bool -> Text -> Text -> CodeGenNodeArg
CodeGenNodeArg'
{ $sel:param:CodeGenNodeArg' :: Maybe Bool
param = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:name:CodeGenNodeArg' :: Text
name = Text
pName_,
$sel:value:CodeGenNodeArg' :: Text
value = Text
pValue_
}
codeGenNodeArg_param :: Lens.Lens' CodeGenNodeArg (Prelude.Maybe Prelude.Bool)
codeGenNodeArg_param :: (Maybe Bool -> f (Maybe Bool))
-> CodeGenNodeArg -> f CodeGenNodeArg
codeGenNodeArg_param = (CodeGenNodeArg -> Maybe Bool)
-> (CodeGenNodeArg -> Maybe Bool -> CodeGenNodeArg)
-> Lens CodeGenNodeArg CodeGenNodeArg (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CodeGenNodeArg' {Maybe Bool
param :: Maybe Bool
$sel:param:CodeGenNodeArg' :: CodeGenNodeArg -> Maybe Bool
param} -> Maybe Bool
param) (\s :: CodeGenNodeArg
s@CodeGenNodeArg' {} Maybe Bool
a -> CodeGenNodeArg
s {$sel:param:CodeGenNodeArg' :: Maybe Bool
param = Maybe Bool
a} :: CodeGenNodeArg)
codeGenNodeArg_name :: Lens.Lens' CodeGenNodeArg Prelude.Text
codeGenNodeArg_name :: (Text -> f Text) -> CodeGenNodeArg -> f CodeGenNodeArg
codeGenNodeArg_name = (CodeGenNodeArg -> Text)
-> (CodeGenNodeArg -> Text -> CodeGenNodeArg)
-> Lens CodeGenNodeArg CodeGenNodeArg Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CodeGenNodeArg' {Text
name :: Text
$sel:name:CodeGenNodeArg' :: CodeGenNodeArg -> Text
name} -> Text
name) (\s :: CodeGenNodeArg
s@CodeGenNodeArg' {} Text
a -> CodeGenNodeArg
s {$sel:name:CodeGenNodeArg' :: Text
name = Text
a} :: CodeGenNodeArg)
codeGenNodeArg_value :: Lens.Lens' CodeGenNodeArg Prelude.Text
codeGenNodeArg_value :: (Text -> f Text) -> CodeGenNodeArg -> f CodeGenNodeArg
codeGenNodeArg_value = (CodeGenNodeArg -> Text)
-> (CodeGenNodeArg -> Text -> CodeGenNodeArg)
-> Lens CodeGenNodeArg CodeGenNodeArg Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CodeGenNodeArg' {Text
value :: Text
$sel:value:CodeGenNodeArg' :: CodeGenNodeArg -> Text
value} -> Text
value) (\s :: CodeGenNodeArg
s@CodeGenNodeArg' {} Text
a -> CodeGenNodeArg
s {$sel:value:CodeGenNodeArg' :: Text
value = Text
a} :: CodeGenNodeArg)
instance Core.FromJSON CodeGenNodeArg where
parseJSON :: Value -> Parser CodeGenNodeArg
parseJSON =
String
-> (Object -> Parser CodeGenNodeArg)
-> Value
-> Parser CodeGenNodeArg
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CodeGenNodeArg"
( \Object
x ->
Maybe Bool -> Text -> Text -> CodeGenNodeArg
CodeGenNodeArg'
(Maybe Bool -> Text -> Text -> CodeGenNodeArg)
-> Parser (Maybe Bool) -> Parser (Text -> Text -> CodeGenNodeArg)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Param")
Parser (Text -> Text -> CodeGenNodeArg)
-> Parser Text -> Parser (Text -> CodeGenNodeArg)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Name")
Parser (Text -> CodeGenNodeArg)
-> Parser Text -> Parser CodeGenNodeArg
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Value")
)
instance Prelude.Hashable CodeGenNodeArg
instance Prelude.NFData CodeGenNodeArg
instance Core.ToJSON CodeGenNodeArg where
toJSON :: CodeGenNodeArg -> Value
toJSON CodeGenNodeArg' {Maybe Bool
Text
value :: Text
name :: Text
param :: Maybe Bool
$sel:value:CodeGenNodeArg' :: CodeGenNodeArg -> Text
$sel:name:CodeGenNodeArg' :: CodeGenNodeArg -> Text
$sel:param:CodeGenNodeArg' :: CodeGenNodeArg -> Maybe Bool
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Param" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
param,
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
"Value" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
value)
]
)