{-# 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.KinesisAnalyticsV2.Types.InputSchemaUpdate where
import qualified Amazonka.Core as Core
import Amazonka.KinesisAnalyticsV2.Types.RecordColumn
import Amazonka.KinesisAnalyticsV2.Types.RecordFormat
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data InputSchemaUpdate = InputSchemaUpdate'
{
InputSchemaUpdate -> Maybe RecordFormat
recordFormatUpdate :: Prelude.Maybe RecordFormat,
InputSchemaUpdate -> Maybe Text
recordEncodingUpdate :: Prelude.Maybe Prelude.Text,
InputSchemaUpdate -> Maybe (NonEmpty RecordColumn)
recordColumnUpdates :: Prelude.Maybe (Prelude.NonEmpty RecordColumn)
}
deriving (InputSchemaUpdate -> InputSchemaUpdate -> Bool
(InputSchemaUpdate -> InputSchemaUpdate -> Bool)
-> (InputSchemaUpdate -> InputSchemaUpdate -> Bool)
-> Eq InputSchemaUpdate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InputSchemaUpdate -> InputSchemaUpdate -> Bool
$c/= :: InputSchemaUpdate -> InputSchemaUpdate -> Bool
== :: InputSchemaUpdate -> InputSchemaUpdate -> Bool
$c== :: InputSchemaUpdate -> InputSchemaUpdate -> Bool
Prelude.Eq, ReadPrec [InputSchemaUpdate]
ReadPrec InputSchemaUpdate
Int -> ReadS InputSchemaUpdate
ReadS [InputSchemaUpdate]
(Int -> ReadS InputSchemaUpdate)
-> ReadS [InputSchemaUpdate]
-> ReadPrec InputSchemaUpdate
-> ReadPrec [InputSchemaUpdate]
-> Read InputSchemaUpdate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InputSchemaUpdate]
$creadListPrec :: ReadPrec [InputSchemaUpdate]
readPrec :: ReadPrec InputSchemaUpdate
$creadPrec :: ReadPrec InputSchemaUpdate
readList :: ReadS [InputSchemaUpdate]
$creadList :: ReadS [InputSchemaUpdate]
readsPrec :: Int -> ReadS InputSchemaUpdate
$creadsPrec :: Int -> ReadS InputSchemaUpdate
Prelude.Read, Int -> InputSchemaUpdate -> ShowS
[InputSchemaUpdate] -> ShowS
InputSchemaUpdate -> String
(Int -> InputSchemaUpdate -> ShowS)
-> (InputSchemaUpdate -> String)
-> ([InputSchemaUpdate] -> ShowS)
-> Show InputSchemaUpdate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InputSchemaUpdate] -> ShowS
$cshowList :: [InputSchemaUpdate] -> ShowS
show :: InputSchemaUpdate -> String
$cshow :: InputSchemaUpdate -> String
showsPrec :: Int -> InputSchemaUpdate -> ShowS
$cshowsPrec :: Int -> InputSchemaUpdate -> ShowS
Prelude.Show, (forall x. InputSchemaUpdate -> Rep InputSchemaUpdate x)
-> (forall x. Rep InputSchemaUpdate x -> InputSchemaUpdate)
-> Generic InputSchemaUpdate
forall x. Rep InputSchemaUpdate x -> InputSchemaUpdate
forall x. InputSchemaUpdate -> Rep InputSchemaUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InputSchemaUpdate x -> InputSchemaUpdate
$cfrom :: forall x. InputSchemaUpdate -> Rep InputSchemaUpdate x
Prelude.Generic)
newInputSchemaUpdate ::
InputSchemaUpdate
newInputSchemaUpdate :: InputSchemaUpdate
newInputSchemaUpdate =
InputSchemaUpdate' :: Maybe RecordFormat
-> Maybe Text -> Maybe (NonEmpty RecordColumn) -> InputSchemaUpdate
InputSchemaUpdate'
{ $sel:recordFormatUpdate:InputSchemaUpdate' :: Maybe RecordFormat
recordFormatUpdate =
Maybe RecordFormat
forall a. Maybe a
Prelude.Nothing,
$sel:recordEncodingUpdate:InputSchemaUpdate' :: Maybe Text
recordEncodingUpdate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:recordColumnUpdates:InputSchemaUpdate' :: Maybe (NonEmpty RecordColumn)
recordColumnUpdates = Maybe (NonEmpty RecordColumn)
forall a. Maybe a
Prelude.Nothing
}
inputSchemaUpdate_recordFormatUpdate :: Lens.Lens' InputSchemaUpdate (Prelude.Maybe RecordFormat)
inputSchemaUpdate_recordFormatUpdate :: (Maybe RecordFormat -> f (Maybe RecordFormat))
-> InputSchemaUpdate -> f InputSchemaUpdate
inputSchemaUpdate_recordFormatUpdate = (InputSchemaUpdate -> Maybe RecordFormat)
-> (InputSchemaUpdate -> Maybe RecordFormat -> InputSchemaUpdate)
-> Lens
InputSchemaUpdate
InputSchemaUpdate
(Maybe RecordFormat)
(Maybe RecordFormat)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputSchemaUpdate' {Maybe RecordFormat
recordFormatUpdate :: Maybe RecordFormat
$sel:recordFormatUpdate:InputSchemaUpdate' :: InputSchemaUpdate -> Maybe RecordFormat
recordFormatUpdate} -> Maybe RecordFormat
recordFormatUpdate) (\s :: InputSchemaUpdate
s@InputSchemaUpdate' {} Maybe RecordFormat
a -> InputSchemaUpdate
s {$sel:recordFormatUpdate:InputSchemaUpdate' :: Maybe RecordFormat
recordFormatUpdate = Maybe RecordFormat
a} :: InputSchemaUpdate)
inputSchemaUpdate_recordEncodingUpdate :: Lens.Lens' InputSchemaUpdate (Prelude.Maybe Prelude.Text)
inputSchemaUpdate_recordEncodingUpdate :: (Maybe Text -> f (Maybe Text))
-> InputSchemaUpdate -> f InputSchemaUpdate
inputSchemaUpdate_recordEncodingUpdate = (InputSchemaUpdate -> Maybe Text)
-> (InputSchemaUpdate -> Maybe Text -> InputSchemaUpdate)
-> Lens
InputSchemaUpdate InputSchemaUpdate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputSchemaUpdate' {Maybe Text
recordEncodingUpdate :: Maybe Text
$sel:recordEncodingUpdate:InputSchemaUpdate' :: InputSchemaUpdate -> Maybe Text
recordEncodingUpdate} -> Maybe Text
recordEncodingUpdate) (\s :: InputSchemaUpdate
s@InputSchemaUpdate' {} Maybe Text
a -> InputSchemaUpdate
s {$sel:recordEncodingUpdate:InputSchemaUpdate' :: Maybe Text
recordEncodingUpdate = Maybe Text
a} :: InputSchemaUpdate)
inputSchemaUpdate_recordColumnUpdates :: Lens.Lens' InputSchemaUpdate (Prelude.Maybe (Prelude.NonEmpty RecordColumn))
inputSchemaUpdate_recordColumnUpdates :: (Maybe (NonEmpty RecordColumn)
-> f (Maybe (NonEmpty RecordColumn)))
-> InputSchemaUpdate -> f InputSchemaUpdate
inputSchemaUpdate_recordColumnUpdates = (InputSchemaUpdate -> Maybe (NonEmpty RecordColumn))
-> (InputSchemaUpdate
-> Maybe (NonEmpty RecordColumn) -> InputSchemaUpdate)
-> Lens
InputSchemaUpdate
InputSchemaUpdate
(Maybe (NonEmpty RecordColumn))
(Maybe (NonEmpty RecordColumn))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputSchemaUpdate' {Maybe (NonEmpty RecordColumn)
recordColumnUpdates :: Maybe (NonEmpty RecordColumn)
$sel:recordColumnUpdates:InputSchemaUpdate' :: InputSchemaUpdate -> Maybe (NonEmpty RecordColumn)
recordColumnUpdates} -> Maybe (NonEmpty RecordColumn)
recordColumnUpdates) (\s :: InputSchemaUpdate
s@InputSchemaUpdate' {} Maybe (NonEmpty RecordColumn)
a -> InputSchemaUpdate
s {$sel:recordColumnUpdates:InputSchemaUpdate' :: Maybe (NonEmpty RecordColumn)
recordColumnUpdates = Maybe (NonEmpty RecordColumn)
a} :: InputSchemaUpdate) ((Maybe (NonEmpty RecordColumn)
-> f (Maybe (NonEmpty RecordColumn)))
-> InputSchemaUpdate -> f InputSchemaUpdate)
-> ((Maybe (NonEmpty RecordColumn)
-> f (Maybe (NonEmpty RecordColumn)))
-> Maybe (NonEmpty RecordColumn)
-> f (Maybe (NonEmpty RecordColumn)))
-> (Maybe (NonEmpty RecordColumn)
-> f (Maybe (NonEmpty RecordColumn)))
-> InputSchemaUpdate
-> f InputSchemaUpdate
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty RecordColumn)
(NonEmpty RecordColumn)
(NonEmpty RecordColumn)
(NonEmpty RecordColumn)
-> Iso
(Maybe (NonEmpty RecordColumn))
(Maybe (NonEmpty RecordColumn))
(Maybe (NonEmpty RecordColumn))
(Maybe (NonEmpty RecordColumn))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
(NonEmpty RecordColumn)
(NonEmpty RecordColumn)
(NonEmpty RecordColumn)
(NonEmpty RecordColumn)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Prelude.Hashable InputSchemaUpdate
instance Prelude.NFData InputSchemaUpdate
instance Core.ToJSON InputSchemaUpdate where
toJSON :: InputSchemaUpdate -> Value
toJSON InputSchemaUpdate' {Maybe (NonEmpty RecordColumn)
Maybe Text
Maybe RecordFormat
recordColumnUpdates :: Maybe (NonEmpty RecordColumn)
recordEncodingUpdate :: Maybe Text
recordFormatUpdate :: Maybe RecordFormat
$sel:recordColumnUpdates:InputSchemaUpdate' :: InputSchemaUpdate -> Maybe (NonEmpty RecordColumn)
$sel:recordEncodingUpdate:InputSchemaUpdate' :: InputSchemaUpdate -> Maybe Text
$sel:recordFormatUpdate:InputSchemaUpdate' :: InputSchemaUpdate -> Maybe RecordFormat
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"RecordFormatUpdate" Text -> RecordFormat -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(RecordFormat -> Pair) -> Maybe RecordFormat -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RecordFormat
recordFormatUpdate,
(Text
"RecordEncodingUpdate" 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
recordEncodingUpdate,
(Text
"RecordColumnUpdates" Text -> NonEmpty RecordColumn -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(NonEmpty RecordColumn -> Pair)
-> Maybe (NonEmpty RecordColumn) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty RecordColumn)
recordColumnUpdates
]
)