{-# 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.NullValueField where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Glue.Types.Datatype
import qualified Amazonka.Prelude as Prelude
data NullValueField = NullValueField'
{
NullValueField -> Text
value :: Prelude.Text,
NullValueField -> Datatype
datatype :: Datatype
}
deriving (NullValueField -> NullValueField -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NullValueField -> NullValueField -> Bool
$c/= :: NullValueField -> NullValueField -> Bool
== :: NullValueField -> NullValueField -> Bool
$c== :: NullValueField -> NullValueField -> Bool
Prelude.Eq, ReadPrec [NullValueField]
ReadPrec NullValueField
Int -> ReadS NullValueField
ReadS [NullValueField]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NullValueField]
$creadListPrec :: ReadPrec [NullValueField]
readPrec :: ReadPrec NullValueField
$creadPrec :: ReadPrec NullValueField
readList :: ReadS [NullValueField]
$creadList :: ReadS [NullValueField]
readsPrec :: Int -> ReadS NullValueField
$creadsPrec :: Int -> ReadS NullValueField
Prelude.Read, Int -> NullValueField -> ShowS
[NullValueField] -> ShowS
NullValueField -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NullValueField] -> ShowS
$cshowList :: [NullValueField] -> ShowS
show :: NullValueField -> String
$cshow :: NullValueField -> String
showsPrec :: Int -> NullValueField -> ShowS
$cshowsPrec :: Int -> NullValueField -> ShowS
Prelude.Show, forall x. Rep NullValueField x -> NullValueField
forall x. NullValueField -> Rep NullValueField x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NullValueField x -> NullValueField
$cfrom :: forall x. NullValueField -> Rep NullValueField x
Prelude.Generic)
newNullValueField ::
Prelude.Text ->
Datatype ->
NullValueField
newNullValueField :: Text -> Datatype -> NullValueField
newNullValueField Text
pValue_ Datatype
pDatatype_ =
NullValueField'
{ $sel:value:NullValueField' :: Text
value = Text
pValue_,
$sel:datatype:NullValueField' :: Datatype
datatype = Datatype
pDatatype_
}
nullValueField_value :: Lens.Lens' NullValueField Prelude.Text
nullValueField_value :: Lens' NullValueField Text
nullValueField_value = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NullValueField' {Text
value :: Text
$sel:value:NullValueField' :: NullValueField -> Text
value} -> Text
value) (\s :: NullValueField
s@NullValueField' {} Text
a -> NullValueField
s {$sel:value:NullValueField' :: Text
value = Text
a} :: NullValueField)
nullValueField_datatype :: Lens.Lens' NullValueField Datatype
nullValueField_datatype :: Lens' NullValueField Datatype
nullValueField_datatype = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NullValueField' {Datatype
datatype :: Datatype
$sel:datatype:NullValueField' :: NullValueField -> Datatype
datatype} -> Datatype
datatype) (\s :: NullValueField
s@NullValueField' {} Datatype
a -> NullValueField
s {$sel:datatype:NullValueField' :: Datatype
datatype = Datatype
a} :: NullValueField)
instance Data.FromJSON NullValueField where
parseJSON :: Value -> Parser NullValueField
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"NullValueField"
( \Object
x ->
Text -> Datatype -> NullValueField
NullValueField'
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
"Value")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Datatype")
)
instance Prelude.Hashable NullValueField where
hashWithSalt :: Int -> NullValueField -> Int
hashWithSalt Int
_salt NullValueField' {Text
Datatype
datatype :: Datatype
value :: Text
$sel:datatype:NullValueField' :: NullValueField -> Datatype
$sel:value:NullValueField' :: NullValueField -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
value
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Datatype
datatype
instance Prelude.NFData NullValueField where
rnf :: NullValueField -> ()
rnf NullValueField' {Text
Datatype
datatype :: Datatype
value :: Text
$sel:datatype:NullValueField' :: NullValueField -> Datatype
$sel:value:NullValueField' :: NullValueField -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
value
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Datatype
datatype
instance Data.ToJSON NullValueField where
toJSON :: NullValueField -> Value
toJSON NullValueField' {Text
Datatype
datatype :: Datatype
value :: Text
$sel:datatype:NullValueField' :: NullValueField -> Datatype
$sel:value:NullValueField' :: NullValueField -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"Value" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
value),
forall a. a -> Maybe a
Prelude.Just (Key
"Datatype" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Datatype
datatype)
]
)