{-# 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.Firehose.Types.SchemaConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data SchemaConfiguration = SchemaConfiguration'
{
SchemaConfiguration -> Maybe Text
catalogId :: Prelude.Maybe Prelude.Text,
SchemaConfiguration -> Maybe Text
databaseName :: Prelude.Maybe Prelude.Text,
SchemaConfiguration -> Maybe Text
region :: Prelude.Maybe Prelude.Text,
SchemaConfiguration -> Maybe Text
roleARN :: Prelude.Maybe Prelude.Text,
SchemaConfiguration -> Maybe Text
tableName :: Prelude.Maybe Prelude.Text,
SchemaConfiguration -> Maybe Text
versionId :: Prelude.Maybe Prelude.Text
}
deriving (SchemaConfiguration -> SchemaConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SchemaConfiguration -> SchemaConfiguration -> Bool
$c/= :: SchemaConfiguration -> SchemaConfiguration -> Bool
== :: SchemaConfiguration -> SchemaConfiguration -> Bool
$c== :: SchemaConfiguration -> SchemaConfiguration -> Bool
Prelude.Eq, ReadPrec [SchemaConfiguration]
ReadPrec SchemaConfiguration
Int -> ReadS SchemaConfiguration
ReadS [SchemaConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SchemaConfiguration]
$creadListPrec :: ReadPrec [SchemaConfiguration]
readPrec :: ReadPrec SchemaConfiguration
$creadPrec :: ReadPrec SchemaConfiguration
readList :: ReadS [SchemaConfiguration]
$creadList :: ReadS [SchemaConfiguration]
readsPrec :: Int -> ReadS SchemaConfiguration
$creadsPrec :: Int -> ReadS SchemaConfiguration
Prelude.Read, Int -> SchemaConfiguration -> ShowS
[SchemaConfiguration] -> ShowS
SchemaConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SchemaConfiguration] -> ShowS
$cshowList :: [SchemaConfiguration] -> ShowS
show :: SchemaConfiguration -> String
$cshow :: SchemaConfiguration -> String
showsPrec :: Int -> SchemaConfiguration -> ShowS
$cshowsPrec :: Int -> SchemaConfiguration -> ShowS
Prelude.Show, forall x. Rep SchemaConfiguration x -> SchemaConfiguration
forall x. SchemaConfiguration -> Rep SchemaConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SchemaConfiguration x -> SchemaConfiguration
$cfrom :: forall x. SchemaConfiguration -> Rep SchemaConfiguration x
Prelude.Generic)
newSchemaConfiguration ::
SchemaConfiguration
newSchemaConfiguration :: SchemaConfiguration
newSchemaConfiguration =
SchemaConfiguration'
{ $sel:catalogId:SchemaConfiguration' :: Maybe Text
catalogId = forall a. Maybe a
Prelude.Nothing,
$sel:databaseName:SchemaConfiguration' :: Maybe Text
databaseName = forall a. Maybe a
Prelude.Nothing,
$sel:region:SchemaConfiguration' :: Maybe Text
region = forall a. Maybe a
Prelude.Nothing,
$sel:roleARN:SchemaConfiguration' :: Maybe Text
roleARN = forall a. Maybe a
Prelude.Nothing,
$sel:tableName:SchemaConfiguration' :: Maybe Text
tableName = forall a. Maybe a
Prelude.Nothing,
$sel:versionId:SchemaConfiguration' :: Maybe Text
versionId = forall a. Maybe a
Prelude.Nothing
}
schemaConfiguration_catalogId :: Lens.Lens' SchemaConfiguration (Prelude.Maybe Prelude.Text)
schemaConfiguration_catalogId :: Lens' SchemaConfiguration (Maybe Text)
schemaConfiguration_catalogId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SchemaConfiguration' {Maybe Text
catalogId :: Maybe Text
$sel:catalogId:SchemaConfiguration' :: SchemaConfiguration -> Maybe Text
catalogId} -> Maybe Text
catalogId) (\s :: SchemaConfiguration
s@SchemaConfiguration' {} Maybe Text
a -> SchemaConfiguration
s {$sel:catalogId:SchemaConfiguration' :: Maybe Text
catalogId = Maybe Text
a} :: SchemaConfiguration)
schemaConfiguration_databaseName :: Lens.Lens' SchemaConfiguration (Prelude.Maybe Prelude.Text)
schemaConfiguration_databaseName :: Lens' SchemaConfiguration (Maybe Text)
schemaConfiguration_databaseName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SchemaConfiguration' {Maybe Text
databaseName :: Maybe Text
$sel:databaseName:SchemaConfiguration' :: SchemaConfiguration -> Maybe Text
databaseName} -> Maybe Text
databaseName) (\s :: SchemaConfiguration
s@SchemaConfiguration' {} Maybe Text
a -> SchemaConfiguration
s {$sel:databaseName:SchemaConfiguration' :: Maybe Text
databaseName = Maybe Text
a} :: SchemaConfiguration)
schemaConfiguration_region :: Lens.Lens' SchemaConfiguration (Prelude.Maybe Prelude.Text)
schemaConfiguration_region :: Lens' SchemaConfiguration (Maybe Text)
schemaConfiguration_region = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SchemaConfiguration' {Maybe Text
region :: Maybe Text
$sel:region:SchemaConfiguration' :: SchemaConfiguration -> Maybe Text
region} -> Maybe Text
region) (\s :: SchemaConfiguration
s@SchemaConfiguration' {} Maybe Text
a -> SchemaConfiguration
s {$sel:region:SchemaConfiguration' :: Maybe Text
region = Maybe Text
a} :: SchemaConfiguration)
schemaConfiguration_roleARN :: Lens.Lens' SchemaConfiguration (Prelude.Maybe Prelude.Text)
schemaConfiguration_roleARN :: Lens' SchemaConfiguration (Maybe Text)
schemaConfiguration_roleARN = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SchemaConfiguration' {Maybe Text
roleARN :: Maybe Text
$sel:roleARN:SchemaConfiguration' :: SchemaConfiguration -> Maybe Text
roleARN} -> Maybe Text
roleARN) (\s :: SchemaConfiguration
s@SchemaConfiguration' {} Maybe Text
a -> SchemaConfiguration
s {$sel:roleARN:SchemaConfiguration' :: Maybe Text
roleARN = Maybe Text
a} :: SchemaConfiguration)
schemaConfiguration_tableName :: Lens.Lens' SchemaConfiguration (Prelude.Maybe Prelude.Text)
schemaConfiguration_tableName :: Lens' SchemaConfiguration (Maybe Text)
schemaConfiguration_tableName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SchemaConfiguration' {Maybe Text
tableName :: Maybe Text
$sel:tableName:SchemaConfiguration' :: SchemaConfiguration -> Maybe Text
tableName} -> Maybe Text
tableName) (\s :: SchemaConfiguration
s@SchemaConfiguration' {} Maybe Text
a -> SchemaConfiguration
s {$sel:tableName:SchemaConfiguration' :: Maybe Text
tableName = Maybe Text
a} :: SchemaConfiguration)
schemaConfiguration_versionId :: Lens.Lens' SchemaConfiguration (Prelude.Maybe Prelude.Text)
schemaConfiguration_versionId :: Lens' SchemaConfiguration (Maybe Text)
schemaConfiguration_versionId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SchemaConfiguration' {Maybe Text
versionId :: Maybe Text
$sel:versionId:SchemaConfiguration' :: SchemaConfiguration -> Maybe Text
versionId} -> Maybe Text
versionId) (\s :: SchemaConfiguration
s@SchemaConfiguration' {} Maybe Text
a -> SchemaConfiguration
s {$sel:versionId:SchemaConfiguration' :: Maybe Text
versionId = Maybe Text
a} :: SchemaConfiguration)
instance Data.FromJSON SchemaConfiguration where
parseJSON :: Value -> Parser SchemaConfiguration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"SchemaConfiguration"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> SchemaConfiguration
SchemaConfiguration'
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
"CatalogId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"DatabaseName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Region")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"RoleARN")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"TableName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"VersionId")
)
instance Prelude.Hashable SchemaConfiguration where
hashWithSalt :: Int -> SchemaConfiguration -> Int
hashWithSalt Int
_salt SchemaConfiguration' {Maybe Text
versionId :: Maybe Text
tableName :: Maybe Text
roleARN :: Maybe Text
region :: Maybe Text
databaseName :: Maybe Text
catalogId :: Maybe Text
$sel:versionId:SchemaConfiguration' :: SchemaConfiguration -> Maybe Text
$sel:tableName:SchemaConfiguration' :: SchemaConfiguration -> Maybe Text
$sel:roleARN:SchemaConfiguration' :: SchemaConfiguration -> Maybe Text
$sel:region:SchemaConfiguration' :: SchemaConfiguration -> Maybe Text
$sel:databaseName:SchemaConfiguration' :: SchemaConfiguration -> Maybe Text
$sel:catalogId:SchemaConfiguration' :: SchemaConfiguration -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
catalogId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
databaseName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
region
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
roleARN
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
tableName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
versionId
instance Prelude.NFData SchemaConfiguration where
rnf :: SchemaConfiguration -> ()
rnf SchemaConfiguration' {Maybe Text
versionId :: Maybe Text
tableName :: Maybe Text
roleARN :: Maybe Text
region :: Maybe Text
databaseName :: Maybe Text
catalogId :: Maybe Text
$sel:versionId:SchemaConfiguration' :: SchemaConfiguration -> Maybe Text
$sel:tableName:SchemaConfiguration' :: SchemaConfiguration -> Maybe Text
$sel:roleARN:SchemaConfiguration' :: SchemaConfiguration -> Maybe Text
$sel:region:SchemaConfiguration' :: SchemaConfiguration -> Maybe Text
$sel:databaseName:SchemaConfiguration' :: SchemaConfiguration -> Maybe Text
$sel:catalogId:SchemaConfiguration' :: SchemaConfiguration -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
catalogId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
databaseName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
region
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
roleARN
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
tableName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
versionId
instance Data.ToJSON SchemaConfiguration where
toJSON :: SchemaConfiguration -> Value
toJSON SchemaConfiguration' {Maybe Text
versionId :: Maybe Text
tableName :: Maybe Text
roleARN :: Maybe Text
region :: Maybe Text
databaseName :: Maybe Text
catalogId :: Maybe Text
$sel:versionId:SchemaConfiguration' :: SchemaConfiguration -> Maybe Text
$sel:tableName:SchemaConfiguration' :: SchemaConfiguration -> Maybe Text
$sel:roleARN:SchemaConfiguration' :: SchemaConfiguration -> Maybe Text
$sel:region:SchemaConfiguration' :: SchemaConfiguration -> Maybe Text
$sel:databaseName:SchemaConfiguration' :: SchemaConfiguration -> Maybe Text
$sel:catalogId:SchemaConfiguration' :: SchemaConfiguration -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"CatalogId" 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 Text
catalogId,
(Key
"DatabaseName" 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 Text
databaseName,
(Key
"Region" 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 Text
region,
(Key
"RoleARN" 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 Text
roleARN,
(Key
"TableName" 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 Text
tableName,
(Key
"VersionId" 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 Text
versionId
]
)