{-# 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.DestinationSchema where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.KinesisAnalytics.Types.RecordFormatType
import qualified Amazonka.Prelude as Prelude
data DestinationSchema = DestinationSchema'
{
DestinationSchema -> RecordFormatType
recordFormatType :: RecordFormatType
}
deriving (DestinationSchema -> DestinationSchema -> Bool
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]
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
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. 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'
{ $sel:recordFormatType:DestinationSchema' :: RecordFormatType
recordFormatType =
RecordFormatType
pRecordFormatType_
}
destinationSchema_recordFormatType :: Lens.Lens' DestinationSchema RecordFormatType
destinationSchema_recordFormatType :: Lens' DestinationSchema RecordFormatType
destinationSchema_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 Data.FromJSON DestinationSchema where
parseJSON :: Value -> Parser DestinationSchema
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"DestinationSchema"
( \Object
x ->
RecordFormatType -> DestinationSchema
DestinationSchema'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"RecordFormatType")
)
instance Prelude.Hashable DestinationSchema where
hashWithSalt :: Int -> DestinationSchema -> Int
hashWithSalt Int
_salt DestinationSchema' {RecordFormatType
recordFormatType :: RecordFormatType
$sel:recordFormatType:DestinationSchema' :: DestinationSchema -> RecordFormatType
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` RecordFormatType
recordFormatType
instance Prelude.NFData DestinationSchema where
rnf :: DestinationSchema -> ()
rnf DestinationSchema' {RecordFormatType
recordFormatType :: RecordFormatType
$sel:recordFormatType:DestinationSchema' :: DestinationSchema -> RecordFormatType
..} =
forall a. NFData a => a -> ()
Prelude.rnf RecordFormatType
recordFormatType
instance Data.ToJSON DestinationSchema where
toJSON :: DestinationSchema -> Value
toJSON DestinationSchema' {RecordFormatType
recordFormatType :: RecordFormatType
$sel:recordFormatType:DestinationSchema' :: DestinationSchema -> RecordFormatType
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"RecordFormatType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= RecordFormatType
recordFormatType)
]
)