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