{-# 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.DestinationSchema where
import qualified Amazonka.Core as Core
import Amazonka.KinesisAnalyticsV2.Types.RecordFormatType
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data DestinationSchema = DestinationSchema'
{
DestinationSchema -> RecordFormatType
recordFormatType :: RecordFormatType
}
deriving (DestinationSchema -> DestinationSchema -> Bool
(DestinationSchema -> DestinationSchema -> Bool)
-> (DestinationSchema -> DestinationSchema -> Bool)
-> Eq DestinationSchema
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DestinationSchema -> DestinationSchema -> Bool
$c/= :: DestinationSchema -> DestinationSchema -> Bool
== :: DestinationSchema -> DestinationSchema -> Bool
$c== :: DestinationSchema -> DestinationSchema -> Bool
Prelude.Eq, ReadPrec [DestinationSchema]
ReadPrec DestinationSchema
Int -> ReadS DestinationSchema
ReadS [DestinationSchema]
(Int -> ReadS DestinationSchema)
-> ReadS [DestinationSchema]
-> ReadPrec DestinationSchema
-> ReadPrec [DestinationSchema]
-> Read DestinationSchema
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DestinationSchema]
$creadListPrec :: ReadPrec [DestinationSchema]
readPrec :: ReadPrec DestinationSchema
$creadPrec :: ReadPrec DestinationSchema
readList :: ReadS [DestinationSchema]
$creadList :: ReadS [DestinationSchema]
readsPrec :: Int -> ReadS DestinationSchema
$creadsPrec :: Int -> ReadS DestinationSchema
Prelude.Read, Int -> DestinationSchema -> ShowS
[DestinationSchema] -> ShowS
DestinationSchema -> String
(Int -> DestinationSchema -> ShowS)
-> (DestinationSchema -> String)
-> ([DestinationSchema] -> ShowS)
-> Show DestinationSchema
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DestinationSchema] -> ShowS
$cshowList :: [DestinationSchema] -> ShowS
show :: DestinationSchema -> String
$cshow :: DestinationSchema -> String
showsPrec :: Int -> DestinationSchema -> ShowS
$cshowsPrec :: Int -> DestinationSchema -> ShowS
Prelude.Show, (forall x. DestinationSchema -> Rep DestinationSchema x)
-> (forall x. Rep DestinationSchema x -> DestinationSchema)
-> Generic DestinationSchema
forall x. Rep DestinationSchema x -> DestinationSchema
forall x. DestinationSchema -> Rep DestinationSchema x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DestinationSchema x -> DestinationSchema
$cfrom :: forall x. DestinationSchema -> Rep DestinationSchema x
Prelude.Generic)
newDestinationSchema ::
RecordFormatType ->
DestinationSchema
newDestinationSchema :: RecordFormatType -> DestinationSchema
newDestinationSchema RecordFormatType
pRecordFormatType_ =
DestinationSchema' :: RecordFormatType -> DestinationSchema
DestinationSchema'
{ $sel:recordFormatType:DestinationSchema' :: RecordFormatType
recordFormatType =
RecordFormatType
pRecordFormatType_
}
destinationSchema_recordFormatType :: Lens.Lens' DestinationSchema RecordFormatType
destinationSchema_recordFormatType :: (RecordFormatType -> f RecordFormatType)
-> DestinationSchema -> f DestinationSchema
destinationSchema_recordFormatType = (DestinationSchema -> RecordFormatType)
-> (DestinationSchema -> RecordFormatType -> DestinationSchema)
-> Lens
DestinationSchema
DestinationSchema
RecordFormatType
RecordFormatType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DestinationSchema' {RecordFormatType
recordFormatType :: RecordFormatType
$sel:recordFormatType:DestinationSchema' :: DestinationSchema -> RecordFormatType
recordFormatType} -> RecordFormatType
recordFormatType) (\s :: DestinationSchema
s@DestinationSchema' {} RecordFormatType
a -> DestinationSchema
s {$sel:recordFormatType:DestinationSchema' :: RecordFormatType
recordFormatType = RecordFormatType
a} :: DestinationSchema)
instance Core.FromJSON DestinationSchema where
parseJSON :: Value -> Parser DestinationSchema
parseJSON =
String
-> (Object -> Parser DestinationSchema)
-> Value
-> Parser DestinationSchema
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"DestinationSchema"
( \Object
x ->
RecordFormatType -> DestinationSchema
DestinationSchema'
(RecordFormatType -> DestinationSchema)
-> Parser RecordFormatType -> Parser DestinationSchema
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser RecordFormatType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"RecordFormatType")
)
instance Prelude.Hashable DestinationSchema
instance Prelude.NFData DestinationSchema
instance Core.ToJSON DestinationSchema where
toJSON :: DestinationSchema -> Value
toJSON DestinationSchema' {RecordFormatType
recordFormatType :: RecordFormatType
$sel:recordFormatType:DestinationSchema' :: DestinationSchema -> RecordFormatType
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"RecordFormatType" Text -> RecordFormatType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= RecordFormatType
recordFormatType)
]
)