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