{-# 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.SourceDescription where
import qualified Amazonka.Core as Core
import Amazonka.Firehose.Types.KinesisStreamSourceDescription
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SourceDescription = SourceDescription'
{
SourceDescription -> Maybe KinesisStreamSourceDescription
kinesisStreamSourceDescription :: Prelude.Maybe KinesisStreamSourceDescription
}
deriving (SourceDescription -> SourceDescription -> Bool
(SourceDescription -> SourceDescription -> Bool)
-> (SourceDescription -> SourceDescription -> Bool)
-> Eq SourceDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SourceDescription -> SourceDescription -> Bool
$c/= :: SourceDescription -> SourceDescription -> Bool
== :: SourceDescription -> SourceDescription -> Bool
$c== :: SourceDescription -> SourceDescription -> Bool
Prelude.Eq, ReadPrec [SourceDescription]
ReadPrec SourceDescription
Int -> ReadS SourceDescription
ReadS [SourceDescription]
(Int -> ReadS SourceDescription)
-> ReadS [SourceDescription]
-> ReadPrec SourceDescription
-> ReadPrec [SourceDescription]
-> Read SourceDescription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SourceDescription]
$creadListPrec :: ReadPrec [SourceDescription]
readPrec :: ReadPrec SourceDescription
$creadPrec :: ReadPrec SourceDescription
readList :: ReadS [SourceDescription]
$creadList :: ReadS [SourceDescription]
readsPrec :: Int -> ReadS SourceDescription
$creadsPrec :: Int -> ReadS SourceDescription
Prelude.Read, Int -> SourceDescription -> ShowS
[SourceDescription] -> ShowS
SourceDescription -> String
(Int -> SourceDescription -> ShowS)
-> (SourceDescription -> String)
-> ([SourceDescription] -> ShowS)
-> Show SourceDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SourceDescription] -> ShowS
$cshowList :: [SourceDescription] -> ShowS
show :: SourceDescription -> String
$cshow :: SourceDescription -> String
showsPrec :: Int -> SourceDescription -> ShowS
$cshowsPrec :: Int -> SourceDescription -> ShowS
Prelude.Show, (forall x. SourceDescription -> Rep SourceDescription x)
-> (forall x. Rep SourceDescription x -> SourceDescription)
-> Generic SourceDescription
forall x. Rep SourceDescription x -> SourceDescription
forall x. SourceDescription -> Rep SourceDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SourceDescription x -> SourceDescription
$cfrom :: forall x. SourceDescription -> Rep SourceDescription x
Prelude.Generic)
newSourceDescription ::
SourceDescription
newSourceDescription :: SourceDescription
newSourceDescription =
SourceDescription' :: Maybe KinesisStreamSourceDescription -> SourceDescription
SourceDescription'
{ $sel:kinesisStreamSourceDescription:SourceDescription' :: Maybe KinesisStreamSourceDescription
kinesisStreamSourceDescription =
Maybe KinesisStreamSourceDescription
forall a. Maybe a
Prelude.Nothing
}
sourceDescription_kinesisStreamSourceDescription :: Lens.Lens' SourceDescription (Prelude.Maybe KinesisStreamSourceDescription)
sourceDescription_kinesisStreamSourceDescription :: (Maybe KinesisStreamSourceDescription
-> f (Maybe KinesisStreamSourceDescription))
-> SourceDescription -> f SourceDescription
sourceDescription_kinesisStreamSourceDescription = (SourceDescription -> Maybe KinesisStreamSourceDescription)
-> (SourceDescription
-> Maybe KinesisStreamSourceDescription -> SourceDescription)
-> Lens
SourceDescription
SourceDescription
(Maybe KinesisStreamSourceDescription)
(Maybe KinesisStreamSourceDescription)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceDescription' {Maybe KinesisStreamSourceDescription
kinesisStreamSourceDescription :: Maybe KinesisStreamSourceDescription
$sel:kinesisStreamSourceDescription:SourceDescription' :: SourceDescription -> Maybe KinesisStreamSourceDescription
kinesisStreamSourceDescription} -> Maybe KinesisStreamSourceDescription
kinesisStreamSourceDescription) (\s :: SourceDescription
s@SourceDescription' {} Maybe KinesisStreamSourceDescription
a -> SourceDescription
s {$sel:kinesisStreamSourceDescription:SourceDescription' :: Maybe KinesisStreamSourceDescription
kinesisStreamSourceDescription = Maybe KinesisStreamSourceDescription
a} :: SourceDescription)
instance Core.FromJSON SourceDescription where
parseJSON :: Value -> Parser SourceDescription
parseJSON =
String
-> (Object -> Parser SourceDescription)
-> Value
-> Parser SourceDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SourceDescription"
( \Object
x ->
Maybe KinesisStreamSourceDescription -> SourceDescription
SourceDescription'
(Maybe KinesisStreamSourceDescription -> SourceDescription)
-> Parser (Maybe KinesisStreamSourceDescription)
-> Parser SourceDescription
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe KinesisStreamSourceDescription)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"KinesisStreamSourceDescription")
)
instance Prelude.Hashable SourceDescription
instance Prelude.NFData SourceDescription