{-# 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.KinesisAnalytics.Types.ReferenceDataSourceUpdate where
import qualified Amazonka.Core as Core
import Amazonka.KinesisAnalytics.Types.S3ReferenceDataSourceUpdate
import Amazonka.KinesisAnalytics.Types.SourceSchema
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ReferenceDataSourceUpdate = ReferenceDataSourceUpdate'
{
ReferenceDataSourceUpdate -> Maybe Text
tableNameUpdate :: Prelude.Maybe Prelude.Text,
ReferenceDataSourceUpdate -> Maybe S3ReferenceDataSourceUpdate
s3ReferenceDataSourceUpdate :: Prelude.Maybe S3ReferenceDataSourceUpdate,
ReferenceDataSourceUpdate -> Maybe SourceSchema
referenceSchemaUpdate :: Prelude.Maybe SourceSchema,
ReferenceDataSourceUpdate -> Text
referenceId :: Prelude.Text
}
deriving (ReferenceDataSourceUpdate -> ReferenceDataSourceUpdate -> Bool
(ReferenceDataSourceUpdate -> ReferenceDataSourceUpdate -> Bool)
-> (ReferenceDataSourceUpdate -> ReferenceDataSourceUpdate -> Bool)
-> Eq ReferenceDataSourceUpdate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReferenceDataSourceUpdate -> ReferenceDataSourceUpdate -> Bool
$c/= :: ReferenceDataSourceUpdate -> ReferenceDataSourceUpdate -> Bool
== :: ReferenceDataSourceUpdate -> ReferenceDataSourceUpdate -> Bool
$c== :: ReferenceDataSourceUpdate -> ReferenceDataSourceUpdate -> Bool
Prelude.Eq, ReadPrec [ReferenceDataSourceUpdate]
ReadPrec ReferenceDataSourceUpdate
Int -> ReadS ReferenceDataSourceUpdate
ReadS [ReferenceDataSourceUpdate]
(Int -> ReadS ReferenceDataSourceUpdate)
-> ReadS [ReferenceDataSourceUpdate]
-> ReadPrec ReferenceDataSourceUpdate
-> ReadPrec [ReferenceDataSourceUpdate]
-> Read ReferenceDataSourceUpdate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReferenceDataSourceUpdate]
$creadListPrec :: ReadPrec [ReferenceDataSourceUpdate]
readPrec :: ReadPrec ReferenceDataSourceUpdate
$creadPrec :: ReadPrec ReferenceDataSourceUpdate
readList :: ReadS [ReferenceDataSourceUpdate]
$creadList :: ReadS [ReferenceDataSourceUpdate]
readsPrec :: Int -> ReadS ReferenceDataSourceUpdate
$creadsPrec :: Int -> ReadS ReferenceDataSourceUpdate
Prelude.Read, Int -> ReferenceDataSourceUpdate -> ShowS
[ReferenceDataSourceUpdate] -> ShowS
ReferenceDataSourceUpdate -> String
(Int -> ReferenceDataSourceUpdate -> ShowS)
-> (ReferenceDataSourceUpdate -> String)
-> ([ReferenceDataSourceUpdate] -> ShowS)
-> Show ReferenceDataSourceUpdate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReferenceDataSourceUpdate] -> ShowS
$cshowList :: [ReferenceDataSourceUpdate] -> ShowS
show :: ReferenceDataSourceUpdate -> String
$cshow :: ReferenceDataSourceUpdate -> String
showsPrec :: Int -> ReferenceDataSourceUpdate -> ShowS
$cshowsPrec :: Int -> ReferenceDataSourceUpdate -> ShowS
Prelude.Show, (forall x.
ReferenceDataSourceUpdate -> Rep ReferenceDataSourceUpdate x)
-> (forall x.
Rep ReferenceDataSourceUpdate x -> ReferenceDataSourceUpdate)
-> Generic ReferenceDataSourceUpdate
forall x.
Rep ReferenceDataSourceUpdate x -> ReferenceDataSourceUpdate
forall x.
ReferenceDataSourceUpdate -> Rep ReferenceDataSourceUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ReferenceDataSourceUpdate x -> ReferenceDataSourceUpdate
$cfrom :: forall x.
ReferenceDataSourceUpdate -> Rep ReferenceDataSourceUpdate x
Prelude.Generic)
newReferenceDataSourceUpdate ::
Prelude.Text ->
ReferenceDataSourceUpdate
newReferenceDataSourceUpdate :: Text -> ReferenceDataSourceUpdate
newReferenceDataSourceUpdate Text
pReferenceId_ =
ReferenceDataSourceUpdate' :: Maybe Text
-> Maybe S3ReferenceDataSourceUpdate
-> Maybe SourceSchema
-> Text
-> ReferenceDataSourceUpdate
ReferenceDataSourceUpdate'
{ $sel:tableNameUpdate:ReferenceDataSourceUpdate' :: Maybe Text
tableNameUpdate =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:s3ReferenceDataSourceUpdate:ReferenceDataSourceUpdate' :: Maybe S3ReferenceDataSourceUpdate
s3ReferenceDataSourceUpdate = Maybe S3ReferenceDataSourceUpdate
forall a. Maybe a
Prelude.Nothing,
$sel:referenceSchemaUpdate:ReferenceDataSourceUpdate' :: Maybe SourceSchema
referenceSchemaUpdate = Maybe SourceSchema
forall a. Maybe a
Prelude.Nothing,
$sel:referenceId:ReferenceDataSourceUpdate' :: Text
referenceId = Text
pReferenceId_
}
referenceDataSourceUpdate_tableNameUpdate :: Lens.Lens' ReferenceDataSourceUpdate (Prelude.Maybe Prelude.Text)
referenceDataSourceUpdate_tableNameUpdate :: (Maybe Text -> f (Maybe Text))
-> ReferenceDataSourceUpdate -> f ReferenceDataSourceUpdate
referenceDataSourceUpdate_tableNameUpdate = (ReferenceDataSourceUpdate -> Maybe Text)
-> (ReferenceDataSourceUpdate
-> Maybe Text -> ReferenceDataSourceUpdate)
-> Lens
ReferenceDataSourceUpdate
ReferenceDataSourceUpdate
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReferenceDataSourceUpdate' {Maybe Text
tableNameUpdate :: Maybe Text
$sel:tableNameUpdate:ReferenceDataSourceUpdate' :: ReferenceDataSourceUpdate -> Maybe Text
tableNameUpdate} -> Maybe Text
tableNameUpdate) (\s :: ReferenceDataSourceUpdate
s@ReferenceDataSourceUpdate' {} Maybe Text
a -> ReferenceDataSourceUpdate
s {$sel:tableNameUpdate:ReferenceDataSourceUpdate' :: Maybe Text
tableNameUpdate = Maybe Text
a} :: ReferenceDataSourceUpdate)
referenceDataSourceUpdate_s3ReferenceDataSourceUpdate :: Lens.Lens' ReferenceDataSourceUpdate (Prelude.Maybe S3ReferenceDataSourceUpdate)
referenceDataSourceUpdate_s3ReferenceDataSourceUpdate :: (Maybe S3ReferenceDataSourceUpdate
-> f (Maybe S3ReferenceDataSourceUpdate))
-> ReferenceDataSourceUpdate -> f ReferenceDataSourceUpdate
referenceDataSourceUpdate_s3ReferenceDataSourceUpdate = (ReferenceDataSourceUpdate -> Maybe S3ReferenceDataSourceUpdate)
-> (ReferenceDataSourceUpdate
-> Maybe S3ReferenceDataSourceUpdate -> ReferenceDataSourceUpdate)
-> Lens
ReferenceDataSourceUpdate
ReferenceDataSourceUpdate
(Maybe S3ReferenceDataSourceUpdate)
(Maybe S3ReferenceDataSourceUpdate)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReferenceDataSourceUpdate' {Maybe S3ReferenceDataSourceUpdate
s3ReferenceDataSourceUpdate :: Maybe S3ReferenceDataSourceUpdate
$sel:s3ReferenceDataSourceUpdate:ReferenceDataSourceUpdate' :: ReferenceDataSourceUpdate -> Maybe S3ReferenceDataSourceUpdate
s3ReferenceDataSourceUpdate} -> Maybe S3ReferenceDataSourceUpdate
s3ReferenceDataSourceUpdate) (\s :: ReferenceDataSourceUpdate
s@ReferenceDataSourceUpdate' {} Maybe S3ReferenceDataSourceUpdate
a -> ReferenceDataSourceUpdate
s {$sel:s3ReferenceDataSourceUpdate:ReferenceDataSourceUpdate' :: Maybe S3ReferenceDataSourceUpdate
s3ReferenceDataSourceUpdate = Maybe S3ReferenceDataSourceUpdate
a} :: ReferenceDataSourceUpdate)
referenceDataSourceUpdate_referenceSchemaUpdate :: Lens.Lens' ReferenceDataSourceUpdate (Prelude.Maybe SourceSchema)
referenceDataSourceUpdate_referenceSchemaUpdate :: (Maybe SourceSchema -> f (Maybe SourceSchema))
-> ReferenceDataSourceUpdate -> f ReferenceDataSourceUpdate
referenceDataSourceUpdate_referenceSchemaUpdate = (ReferenceDataSourceUpdate -> Maybe SourceSchema)
-> (ReferenceDataSourceUpdate
-> Maybe SourceSchema -> ReferenceDataSourceUpdate)
-> Lens
ReferenceDataSourceUpdate
ReferenceDataSourceUpdate
(Maybe SourceSchema)
(Maybe SourceSchema)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReferenceDataSourceUpdate' {Maybe SourceSchema
referenceSchemaUpdate :: Maybe SourceSchema
$sel:referenceSchemaUpdate:ReferenceDataSourceUpdate' :: ReferenceDataSourceUpdate -> Maybe SourceSchema
referenceSchemaUpdate} -> Maybe SourceSchema
referenceSchemaUpdate) (\s :: ReferenceDataSourceUpdate
s@ReferenceDataSourceUpdate' {} Maybe SourceSchema
a -> ReferenceDataSourceUpdate
s {$sel:referenceSchemaUpdate:ReferenceDataSourceUpdate' :: Maybe SourceSchema
referenceSchemaUpdate = Maybe SourceSchema
a} :: ReferenceDataSourceUpdate)
referenceDataSourceUpdate_referenceId :: Lens.Lens' ReferenceDataSourceUpdate Prelude.Text
referenceDataSourceUpdate_referenceId :: (Text -> f Text)
-> ReferenceDataSourceUpdate -> f ReferenceDataSourceUpdate
referenceDataSourceUpdate_referenceId = (ReferenceDataSourceUpdate -> Text)
-> (ReferenceDataSourceUpdate -> Text -> ReferenceDataSourceUpdate)
-> Lens
ReferenceDataSourceUpdate ReferenceDataSourceUpdate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReferenceDataSourceUpdate' {Text
referenceId :: Text
$sel:referenceId:ReferenceDataSourceUpdate' :: ReferenceDataSourceUpdate -> Text
referenceId} -> Text
referenceId) (\s :: ReferenceDataSourceUpdate
s@ReferenceDataSourceUpdate' {} Text
a -> ReferenceDataSourceUpdate
s {$sel:referenceId:ReferenceDataSourceUpdate' :: Text
referenceId = Text
a} :: ReferenceDataSourceUpdate)
instance Prelude.Hashable ReferenceDataSourceUpdate
instance Prelude.NFData ReferenceDataSourceUpdate
instance Core.ToJSON ReferenceDataSourceUpdate where
toJSON :: ReferenceDataSourceUpdate -> Value
toJSON ReferenceDataSourceUpdate' {Maybe Text
Maybe S3ReferenceDataSourceUpdate
Maybe SourceSchema
Text
referenceId :: Text
referenceSchemaUpdate :: Maybe SourceSchema
s3ReferenceDataSourceUpdate :: Maybe S3ReferenceDataSourceUpdate
tableNameUpdate :: Maybe Text
$sel:referenceId:ReferenceDataSourceUpdate' :: ReferenceDataSourceUpdate -> Text
$sel:referenceSchemaUpdate:ReferenceDataSourceUpdate' :: ReferenceDataSourceUpdate -> Maybe SourceSchema
$sel:s3ReferenceDataSourceUpdate:ReferenceDataSourceUpdate' :: ReferenceDataSourceUpdate -> Maybe S3ReferenceDataSourceUpdate
$sel:tableNameUpdate:ReferenceDataSourceUpdate' :: ReferenceDataSourceUpdate -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"TableNameUpdate" 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
tableNameUpdate,
(Text
"S3ReferenceDataSourceUpdate" Text -> S3ReferenceDataSourceUpdate -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(S3ReferenceDataSourceUpdate -> Pair)
-> Maybe S3ReferenceDataSourceUpdate -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe S3ReferenceDataSourceUpdate
s3ReferenceDataSourceUpdate,
(Text
"ReferenceSchemaUpdate" Text -> SourceSchema -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(SourceSchema -> Pair) -> Maybe SourceSchema -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SourceSchema
referenceSchemaUpdate,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ReferenceId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
referenceId)
]
)