{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SchemaConfiguration = SchemaConfiguration'
{
SchemaConfiguration -> Maybe Text
versionId :: Prelude.Maybe Prelude.Text,
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
tableName :: Prelude.Maybe Prelude.Text,
SchemaConfiguration -> Maybe Text
roleARN :: Prelude.Maybe Prelude.Text
}
deriving (SchemaConfiguration -> SchemaConfiguration -> Bool
(SchemaConfiguration -> SchemaConfiguration -> Bool)
-> (SchemaConfiguration -> SchemaConfiguration -> Bool)
-> Eq SchemaConfiguration
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]
(Int -> ReadS SchemaConfiguration)
-> ReadS [SchemaConfiguration]
-> ReadPrec SchemaConfiguration
-> ReadPrec [SchemaConfiguration]
-> Read 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
(Int -> SchemaConfiguration -> ShowS)
-> (SchemaConfiguration -> String)
-> ([SchemaConfiguration] -> ShowS)
-> Show SchemaConfiguration
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. SchemaConfiguration -> Rep SchemaConfiguration x)
-> (forall x. Rep SchemaConfiguration x -> SchemaConfiguration)
-> Generic SchemaConfiguration
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' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> SchemaConfiguration
SchemaConfiguration'
{ $sel:versionId:SchemaConfiguration' :: Maybe Text
versionId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:catalogId:SchemaConfiguration' :: Maybe Text
catalogId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:databaseName:SchemaConfiguration' :: Maybe Text
databaseName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:region:SchemaConfiguration' :: Maybe Text
region = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tableName:SchemaConfiguration' :: Maybe Text
tableName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:roleARN:SchemaConfiguration' :: Maybe Text
roleARN = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
schemaConfiguration_versionId :: Lens.Lens' SchemaConfiguration (Prelude.Maybe Prelude.Text)
schemaConfiguration_versionId :: (Maybe Text -> f (Maybe Text))
-> SchemaConfiguration -> f SchemaConfiguration
schemaConfiguration_versionId = (SchemaConfiguration -> Maybe Text)
-> (SchemaConfiguration -> Maybe Text -> SchemaConfiguration)
-> Lens
SchemaConfiguration SchemaConfiguration (Maybe Text) (Maybe Text)
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)
schemaConfiguration_catalogId :: Lens.Lens' SchemaConfiguration (Prelude.Maybe Prelude.Text)
schemaConfiguration_catalogId :: (Maybe Text -> f (Maybe Text))
-> SchemaConfiguration -> f SchemaConfiguration
schemaConfiguration_catalogId = (SchemaConfiguration -> Maybe Text)
-> (SchemaConfiguration -> Maybe Text -> SchemaConfiguration)
-> Lens
SchemaConfiguration SchemaConfiguration (Maybe Text) (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> SchemaConfiguration -> f SchemaConfiguration
schemaConfiguration_databaseName = (SchemaConfiguration -> Maybe Text)
-> (SchemaConfiguration -> Maybe Text -> SchemaConfiguration)
-> Lens
SchemaConfiguration SchemaConfiguration (Maybe Text) (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> SchemaConfiguration -> f SchemaConfiguration
schemaConfiguration_region = (SchemaConfiguration -> Maybe Text)
-> (SchemaConfiguration -> Maybe Text -> SchemaConfiguration)
-> Lens
SchemaConfiguration SchemaConfiguration (Maybe Text) (Maybe Text)
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_tableName :: Lens.Lens' SchemaConfiguration (Prelude.Maybe Prelude.Text)
schemaConfiguration_tableName :: (Maybe Text -> f (Maybe Text))
-> SchemaConfiguration -> f SchemaConfiguration
schemaConfiguration_tableName = (SchemaConfiguration -> Maybe Text)
-> (SchemaConfiguration -> Maybe Text -> SchemaConfiguration)
-> Lens
SchemaConfiguration SchemaConfiguration (Maybe Text) (Maybe Text)
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_roleARN :: Lens.Lens' SchemaConfiguration (Prelude.Maybe Prelude.Text)
schemaConfiguration_roleARN :: (Maybe Text -> f (Maybe Text))
-> SchemaConfiguration -> f SchemaConfiguration
schemaConfiguration_roleARN = (SchemaConfiguration -> Maybe Text)
-> (SchemaConfiguration -> Maybe Text -> SchemaConfiguration)
-> Lens
SchemaConfiguration SchemaConfiguration (Maybe Text) (Maybe Text)
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)
instance Core.FromJSON SchemaConfiguration where
parseJSON :: Value -> Parser SchemaConfiguration
parseJSON =
String
-> (Object -> Parser SchemaConfiguration)
-> Value
-> Parser SchemaConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SchemaConfiguration"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> SchemaConfiguration
SchemaConfiguration'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> SchemaConfiguration)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> SchemaConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"VersionId")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> SchemaConfiguration)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> SchemaConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CatalogId")
Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> SchemaConfiguration)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe Text -> Maybe Text -> SchemaConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DatabaseName")
Parser
(Maybe Text -> Maybe Text -> Maybe Text -> SchemaConfiguration)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> SchemaConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Region")
Parser (Maybe Text -> Maybe Text -> SchemaConfiguration)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> SchemaConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TableName")
Parser (Maybe Text -> SchemaConfiguration)
-> Parser (Maybe Text) -> Parser SchemaConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RoleARN")
)
instance Prelude.Hashable SchemaConfiguration
instance Prelude.NFData SchemaConfiguration
instance Core.ToJSON SchemaConfiguration where
toJSON :: SchemaConfiguration -> Value
toJSON SchemaConfiguration' {Maybe Text
roleARN :: Maybe Text
tableName :: Maybe Text
region :: Maybe Text
databaseName :: Maybe Text
catalogId :: Maybe Text
versionId :: Maybe Text
$sel:roleARN:SchemaConfiguration' :: SchemaConfiguration -> Maybe Text
$sel:tableName:SchemaConfiguration' :: SchemaConfiguration -> Maybe Text
$sel:region:SchemaConfiguration' :: SchemaConfiguration -> Maybe Text
$sel:databaseName:SchemaConfiguration' :: SchemaConfiguration -> Maybe Text
$sel:catalogId:SchemaConfiguration' :: SchemaConfiguration -> Maybe Text
$sel:versionId:SchemaConfiguration' :: SchemaConfiguration -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"VersionId" 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
versionId,
(Text
"CatalogId" 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
catalogId,
(Text
"DatabaseName" 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
databaseName,
(Text
"Region" 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
region,
(Text
"TableName" 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
tableName,
(Text
"RoleARN" 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
roleARN
]
)