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